Skip to content

fix: clear stale nmmo3 entity observations - #634

Open
jokrasno wants to merge 1 commit into
PufferAI:4.0from
jokrasno:fix/nmmo3-stale-entity-observations
Open

fix: clear stale nmmo3 entity observations#634
jokrasno wants to merge 1 commit into
PufferAI:4.0from
jokrasno:fix/nmmo3-stale-entity-observations

Conversation

@jokrasno

Copy link
Copy Markdown

Summary

  • clear nmmo3 observation entity bytes 4-9 when the authoritative pids cell is empty
  • add a native regression that moves a real Entity between cells and exercises the production allocate_mmo() / compute_all_obs() path
  • document Linux and macOS build/run commands for the native regression

Fixes #629.

Verification

On pristine 4.0 (c5d3c637), the regression failed after the entity moved:

empty cell retained entity bytes: [2, 3, 4, 4, 1, 2]
exit code: 1

The identically rebuilt test exits 0 after this change. It uses the real MMO and Entity structures and statically checks the 1,707-byte observation layout; no encoder logic is copied into the test.

Additional checks:

  • optimized full nmmo3.c desktop build: passed
  • python -m compileall -q pufferlib: passed
  • pytest tests/test_import_performance.py -q: 1 passed
  • git diff --check: passed

Compatibility note

This intentionally changes empty-cell observations from stale last-seen entity data to truthful snapshot semantics. As discussed in #629, existing weights may have learned to use the residue as an implicit memory channel. This PR keeps the correctness fix narrow; if compatibility needs an opt-in flag or environment-version boundary, I am happy to adapt it to the maintainers' preferred policy.

The native harness follows the repository's documented-command convention but is not currently discovered by existing CI. Wiring it into CI remains a maintainer integration decision.

@jokrasno
jokrasno force-pushed the fix/nmmo3-stale-entity-observations branch from eee0de3 to 783d5a1 Compare August 16, 2026 21:39
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.

nmmo3: observation encoder never clears entity bytes — stale "live enemy" claims persist indefinitely

1 participant