Skip to content

fix(nle): sync top-level include/nleobs.h with src/include (ABI fix, missed by PR #5) - #6

Merged
liujonathan24 merged 1 commit into
mainfrom
fix-nleobs-header-sync
Jun 26, 2026
Merged

fix(nle): sync top-level include/nleobs.h with src/include (ABI fix, missed by PR #5)#6
liujonathan24 merged 1 commit into
mainfrom
fix-nleobs-header-sync

Conversation

@liujonathan24

Copy link
Copy Markdown
Owner

Follow-up to #5 (merged at 1ff9e00). This one-commit fix (405d4ad) was pushed to the PR branch after #5 was merged, so it never landed in main.

Problem

The fork ships two copies of nleobs.h:

  • src/include/nleobs.h — cmake builds libnethack.so from this (has tune_n/tune_idx/tune_val + datadir[256]).
  • include/nleobs.h — external consumers compile against this (e.g. PufferLib's ocean/nethack via -I vendor/nle/include).

Earlier commits added the new nle_settings fields only to src/include/, leaving the top-level copy short and misaligned. A consumer built against include/nleobs.h passes a smaller struct than libnethack.so expects → the engine reads datadir past the caller's struct → bogus error("DATADIR too long") at nle_start. (Reproduced building PufferLib against the engine.)

Fix

Make the two headers byte-identical. Pure header sync, no logic change.

After merge, the harness submodule should be re-bumped to the new main to propagate it.

The nle_settings struct gained tune_n/tune_idx/tune_val (difficulty knobs)
and datadir[256] (read-only datadir split) in src/include/nleobs.h, but the
parallel top-level include/nleobs.h copy was never updated. External consumers
that include the top-level header (e.g. PufferLib's ocean/nethack binding via
-I vendor/nle/include) compiled against the shorter, misaligned struct while
libnethack.so was built from src/include — an ABI mismatch that surfaced as a
bogus 'DATADIR too long' error (the engine read datadir past the caller's
struct). Keep the two copies byte-identical.
@liujonathan24
liujonathan24 merged commit 71f0be3 into main Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant