sandbox_scene: stream placements when finding the automatic center #2444

Merged
kirigayakazima merged 1 commit from upstream-pr/2444 into main 2026-11-28 15:13:00 +00:00
kirigayakazima commented 2026-11-27 10:17:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T10:17:02Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5524929677 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2444). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-27T10:17:02Z. --- 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 commented 2026-11-27 15:10:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T15:10:56Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6090161577 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2444#pullrequestreview-6090161577). Originally posted by [MSedgeMC](https://github.com/MSedgeMC) on 2026-11-27T15:10:56Z. **Review:** COMMENTED --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T09:46:39Z.


#2444 | head ab2c132233 (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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237458785 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2444#issuecomment-7237458785). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T09:46:39Z. --- #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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:12:57Z.


Red/green: pytest tests/test_sandbox_scene_build.py fails on main (1 failed) and passes on head ab2c132233 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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7241293069 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2444#issuecomment-7241293069). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T15:12:57Z. --- 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 reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2444
No description provided.