Skip to content

BUILD-1938: preserve existing images during sandbox checks - #6009

Open
venetanji wants to merge 1 commit into
ItsNotRexed:mainfrom
venetanji:fix/sandbox-private-readback
Open

venetanji wants to merge 1 commit into
ItsNotRexed:mainfrom
venetanji:fix/sandbox-private-readback

Conversation

@venetanji

Copy link
Copy Markdown

Claimed in the coordination issue as: BUILD-1938, temporary-frame slice of this three-part claim, carried into #5934.

Depends on: #5830, #4119, #4436 (shared-file conflicts / merge ordering; this patch builds independently on main).

What and why

Running sandbox.py --check --scene saved.bin currently asks the renderer to write saved.bin.ppm, then unconditionally removes that file. If the user already has an image there, the check overwrites and deletes it, including when the renderer exits with a failure.

Allocate a separate temporary PPM for the check, and clean up that owned file afterward. An explicitly saved scene remains available, and an existing sibling image is preserved.

Tested

Base 561b65a832218fbb9e6d2effd392a8eef093a3f8; patch head a91e42fb1ef378c3c1215070ca8f46ec56d54eb0.

  • python -I -B tests/test_sandbox_output.py -v: four tests pass. Covers preservation of an existing image with renderer exits 0/1/77, cleanup of temporary scenes/frames, a launch exception and the absence of a leftover image beside a saved scene. The preservation regression fails on the original implementation.
  • test_sandbox_pick.py (6), test_sandbox_scene.py (10), and test_text_write_line_endings.py (3) pass. git diff --check passes.
  • Tested together with the other BUILD-1938 slices, RT-432: cull forward-sandbox draws outside the camera frustum #5830 and vk_descriptor_bench, vk_sandbox: pick the GPU through LEONIDA_VK_DEVICE #5889 in a private integration checkout: affected CPU/Python checks and both cards' synthetic Vulkan culling suites pass. RTX 3080 Ti / RTX 3090, NVIDIA 615.78.08, Arch Linux, Python 3.14.8. This branch's tests require no GPU. Native Windows has not been run for this change.

The three new slices merge cleanly with one another. This slice has one tools/sandbox.py conflict with #5830: retain its draw command construction and this patch's temporary frame allocation. That resolution was tested in the integration checkout. The older deferred/shadow refactors also overlap the shared file and already conflict with current main. All fixtures are synthetic; no game files.

AI-assisted: yes, Codex.

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.
  • Translator contract update: not applicable; no translator rule changes.

@leozinhoszg

Copy link
Copy Markdown
Contributor

Tested a91e42fb on Windows 11 Pro (26200), CPython 3.14.7, CPU only, no game files: pass with notes.

AI-assisted.

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.

2 participants