From e8a22d2473682a860045c074cac10880d49e2aed Mon Sep 17 00:00:00 2001 From: "Jonathan B. Coe" Date: Fri, 20 Mar 2026 20:05:43 +0000 Subject: [PATCH 1/2] Revert "Fast rebuilds of C/C++ code when needed. (#106)" This reverts commit 0b9648399a4ec53652a78e0ef3993ba82860b281. Fast rebuilds with uv and scikit-build and use of Python tooling within a CMake build are incompatible. The isolated environment used for the build means that the Python executable cached in the build directory is not valid when the build directory is used for a rebuild. --- CMakeLists.txt | 12 ------------ pyproject.toml | 2 -- 2 files changed, 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2036b9c7d..48a45e4b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,18 +12,6 @@ endif() string(REGEX MATCH "^[0-9]+(\\.[0-9]+)*" CMAKE_NLE_VERSION "${NLE_VERSION}") project(nle VERSION ${CMAKE_NLE_VERSION}) -# Only enable ccache if this is the main project, not a sub-dependency. -if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) - find_program(CCACHE_EXECUTABLE ccache) - if(CCACHE_EXECUTABLE) - message(STATUS "ccache found, enabling for C and C++") - set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}") - set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}") - else() - message(STATUS "ccache not found, proceeding without it") - endif() -endif() - if(CMAKE_BUILD_TYPE MATCHES Debug) message("Debug build.") # Unclear if this is even necessary. `dsymutil rlmain -o rlmain.dSYM` seems to diff --git a/pyproject.toml b/pyproject.toml index f6d9640f3..d1ff3031e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,6 @@ cmake.build-type = "Release" cmake.args = ["-DHACKDIR=nle/nethackdir", "-DPYTHON_PACKAGE_NAME=nle"] minimum-version = "build-system.requires" metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" -build-dir = "build/{wheel_tag}" -editable.rebuild = true generate = [ { path = "nle/version.py", template = '__version__ = "${version}"' }, ] From aaedc967c66cddb99d6f3b8e2948851c10d0a7fb Mon Sep 17 00:00:00 2001 From: "Jonathan B. Coe" Date: Sat, 21 Mar 2026 22:13:56 +0000 Subject: [PATCH 2/2] Added explicit ORDER BY .gameid to SQL queries to ensure deterministic ordering --- nle/dataset/dataset.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nle/dataset/dataset.py b/nle/dataset/dataset.py index 665967609..4a2e37e92 100644 --- a/nle/dataset/dataset.py +++ b/nle/dataset/dataset.py @@ -211,13 +211,15 @@ def __init__( SELECT ttyrecs.gameid, ttyrecs.part, ttyrecs.path FROM ttyrecs INNER JOIN datasets ON ttyrecs.gameid=datasets.gameid - WHERE datasets.dataset_name=?""" + WHERE datasets.dataset_name=? + ORDER BY ttyrecs.gameid""" meta_sql = """ SELECT games.* FROM games INNER JOIN datasets ON games.gameid=datasets.gameid - WHERE datasets.dataset_name=?""" + WHERE datasets.dataset_name=? + ORDER BY games.gameid""" if subselect_sql: path_select = """ @@ -225,7 +227,8 @@ def __init__( FROM ttyrecs INNER JOIN datasets ON ttyrecs.gameid=datasets.gameid WHERE datasets.dataset_name=? - AND ttyrecs.gameid IN (%s)""" + AND ttyrecs.gameid IN (%s) + ORDER BY ttyrecs.gameid""" core_sql = path_select % subselect_sql meta_select = """ @@ -233,7 +236,8 @@ def __init__( FROM games INNER JOIN datasets ON games.gameid=datasets.gameid WHERE datasets.dataset_name=? - AND games.gameid IN (%s)""" + AND games.gameid IN (%s) + ORDER BY games.gameid""" meta_sql = meta_select % subselect_sql sql_args = subselect_sql_args if subselect_sql_args else () sql_args = (dataset_name,) + sql_args