sandbox_scene: stream placements when finding the automatic center #2444

Merged
leonida/mandy
kirigayakazima merged 1 commit from codex/sandbox-scene-stream-autocenter into main 2026-11-28 15:13:00 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-27 10:17:02 +00:00

Claimed in the coordination issue as: SANDBOX-SCENE-STREAM-AUTOCENTER

What and why

Finding the densest resolved cell retained every decoded placement record, including all distant and unresolved props. For regular inputs, count cells on a first streaming pass and reopen the JSONL for selection. Non-regular inputs retain the one-read behavior. The synthetic 1,201-row regression checks the center, placed count, exact selected-row count and peak storage. Traced peak was 6,871,132 bytes before and 166,116 bytes in the integrated run on this machine.

Tested

Windows, Python 3.14.7, synthetic fixtures.

  • python -I tests/test_sandbox_scene_build.py
  • python -I tests/test_sandbox_scene.py
  • Changed-path game-data scan and git diff --check passed.
  • Shared main baseline: 6,374 translator semantic tests passed across 500 files. The combined five-topic checkout passed 172 focused tests.

GPUs tested: N/A (CPU-only).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.
Claimed in the coordination issue as: [SANDBOX-SCENE-STREAM-AUTOCENTER](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215561737) ### What and why Finding the densest resolved cell retained every decoded placement record, including all distant and unresolved props. For regular inputs, count cells on a first streaming pass and reopen the JSONL for selection. Non-regular inputs retain the one-read behavior. The synthetic 1,201-row regression checks the center, placed count, exact selected-row count and peak storage. Traced peak was 6,871,132 bytes before and 166,116 bytes in the integrated run on this machine. ### Tested Windows, Python 3.14.7, synthetic fixtures. - `python -I tests/test_sandbox_scene_build.py` - `python -I tests/test_sandbox_scene.py` - Changed-path game-data scan and `git diff --check` passed. - Shared main baseline: 6,374 translator semantic tests passed across 500 files. The combined five-topic checkout passed 172 focused tests. GPUs tested: N/A (CPU-only). AI-assisted: Yes. ### Checklist - [x] Based on current main and merges cleanly with the tested base. - [x] One topic. - [x] No game data, keys or decryption. - Translator contract table: N/A.
MSedgeMC reviewed 2026-11-27 15:10:56 +00:00
MSedgeMC left a comment
No description provided.
Verified on the PR branch: python3 -m unittest tests.test_sandbox_scene_build -v -> 9 tests OK, including the new streaming-placement/center cases (the old tests.test_sandbox_scene module also passes, 12 tests). Not approving yet: the branch is 606 commits behind current main, so a rebase is needed before reviewing the final diff.
zmasi commented 2026-11-28 09:46:39 +00:00

#2444 | head ab2c1322337b82e1c8d8079cb5e2154c7b3e52ec (merged cleanly with main 3ca0707dd) | python -I tests/test_sandbox_scene_build.py | red on main: FAILED (failures=1) (test_auto_center_does_not_keep_distant_placement_payloads: 6747050 not less than 4194304) | green on PR+main: 9 tests OK (-k test_auto_center_does_not_keep_distant_placement_payloads: 1 test OK) | Windows 11, Python 3.12.10 | AI-assisted: yes

Audited build in tools/sandbox_scene.py (streaming world_build.iter_placements for automatic centering when args.entities is a regular file while keeping list(rows) fallback for single-pass pipes), and verified both PR + main (3ca0707dd) and a combined 3-way main + #2444 + #2443 + #2442 merge (0 conflicts; 9 tests OK in tests/test_sandbox_scene_build.py, 14 tests OK in tests/test_sandbox_scene.py). Also passed tests/test_text_write_line_endings.py (3 OK), tests/test_runner_calls_all_tests.py (3 OK), and scripts/check_no_game_data.py.

#2444 | head ab2c1322337b82e1c8d8079cb5e2154c7b3e52ec (merged cleanly with main 3ca0707dd) | `python -I tests/test_sandbox_scene_build.py` | red on main: `FAILED (failures=1)` (`test_auto_center_does_not_keep_distant_placement_payloads`: `6747050 not less than 4194304`) | green on PR+main: `9 tests OK` (`-k test_auto_center_does_not_keep_distant_placement_payloads`: `1 test OK`) | Windows 11, Python 3.12.10 | AI-assisted: yes Audited `build` in `tools/sandbox_scene.py` (streaming `world_build.iter_placements` for automatic centering when `args.entities` is a regular file while keeping `list(rows)` fallback for single-pass pipes), and verified both `PR + main` (`3ca0707dd`) and a combined 3-way `main + #2444 + #2443 + #2442` merge (`0` conflicts; `9 tests OK` in `tests/test_sandbox_scene_build.py`, `14 tests OK` in `tests/test_sandbox_scene.py`). Also passed `tests/test_text_write_line_endings.py` (`3 OK`), `tests/test_runner_calls_all_tests.py` (`3 OK`), and `scripts/check_no_game_data.py`.
MoonEyes commented 2026-11-28 15:12:57 +00:00

Red/green: pytest tests/test_sandbox_scene_build.py fails on main (1 failed) and passes on head ab2c1322337b merged with main (9 passed, 2 subtests passed).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: `pytest tests/test_sandbox_scene_build.py` fails on main (1 failed) and passes on head ab2c1322337b merged with main (9 passed, 2 subtests passed). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.