fix(oot): a reused box light starts neutral, so it no longer keeps another light's dimming (Ganon's Castle's dark squares) #2666

Merged
HumanBean merged 1 commit from PirateKingIsh/Longshot:fix/box-light-reuse into main 2026-11-28 04:22:27 +00:00
Contributor

Summary

In Ganon's Tower, defeat the two Iron Knuckles, leave their room through the corridor, then return. On the affected build, the corridor can flicker and a large dark rectangle appears across the room's floor, with a sharp straight boundary. Loading the saved corridor and walking back into the room also reproduces it. This change stops a reused box light from inheriting another light's dimming. The tested corridor and room remained normally lit after entry.

Box lights come from a pool. Reuse preserves the previous owner's rotation, half-extents, blend vectors and dimming factor when the new owner has no parameter resource to replace them. The observed corner box inherited a ceiling dimmer's half-extents of 17,4,17 and factor 0.1 at its own position, darkening a 34×8×34 region.

Read game/oot_box_light.c first, then the light.boxAcquired site and tests/test_box_light_reuse.py. The hook runs after the acquire callback, while both pool and light locks are held and before the new owner can load parameters. For the box-light class only, it restores the constructor's 52 parameter bytes and sets the transform's dirty bit. It preserves ownership, position and cached matrices; the game's transform update rebuilds the matrices, and an owner with parameters still loads them afterward.

How the cause was established (all on this PC; the raw captures and memory reads are game-derived and stay local):

  • Turning Longshot's switchable changes back did not help: one run with 38 HOS_ switches set back and one with 41 RX_ renderer switches set back both still gave the dark room.
  • Setting the type-102 boxes' factor from 0.1 to 1.0 in both copies of the light records the GPU reads (checked by reading back) removed the sharp boundary, and restoring 0.1 brought it back.
  • The box packer reads size and factor from the box object, and a read-only sampler over the control bridge (HOS_CONTROL_MEM=ro) then caught the reuse described above, twice, on main.
  • A Switch 2 playthrough shows this room evenly lit. Why the console avoids this state is not established; the reset makes a reused box start from the game's own neutral values whatever the order.

Refs #886, #1305, #2458. The gameplay result covers the corridor and two-Iron-Knuckle room; other reported locations have not been verified fixed.

Testing

Tested: PirateKingIsh, Windows 11, RTX 5090, NVIDIA 621.40. Built main 86b3b9e4 and candidate c6f30aea2 with llvm-mingw clang 23.1.5 and the same translator revision; played the candidate in the room and both builds in Hyrule Field.

  • Before, on main at 09dea503 (nine commits before 86b3b9e4, none of them in game/, host/ or the hook-site files): the room had the dark area with a sharp straight edge in the first capture, in both door-timeline runs and in the sampler run. The sampler saw pool slots 99 and 110 go from the ceiling dimmer (half-extents 17,4,17, factor 0.1) through a released state to corner boxes with all 52 parameter bytes unchanged. Two pictures of that room on main are attached.
  • On the exact candidate, walked from the private corridor save into the knights' room and stood still for at least 30 seconds, then moved beside the chest. No corridor flicker was noticed and no dark square or sharp boundary was visible. Both room pictures show normal floor lighting. Render resolution was explicitly set to 100% and read back; cap 60, FPS counter on, Debug tools off. The recorded picture size was 3416×1440.
  • An earlier probe build, based on 09dea503a2ef with the same reset code, recorded two real slot reuses: both returned to neutral parameters while the legitimate ceiling dimmer retained its own parameters. Those internal observations are separate from the current candidate's visual check.
  • Three ordinary Hyrule Field views were checked on main and candidate with matching settings, recorded positions and camera yaw. Ground lighting and shadows looked normal on both. These are checks for new lighting problems, not a reproduction or claimed fix of the field report. Navigation replay diverged; the still comparisons use the independently checked final viewpoints, not a successful-replay claim.
  • The new game-free regression runs the callback through the lowered hook in a synthetic pool. Main fails at getf(i) == expected; the candidate passes. It covers reset under both locks, later owner parameters, repeated reuse, another class, null input, the disabled site and preserved registers. All 142 existing site placements are unchanged; the candidate adds exactly one. Both full Windows builds completed with zero failed units.

The changed-check collection returned 34 passed / 1 failed / 3 skipped; test_site_chain.py also fails on clean main. The full candidate collection returned 609 passed / 68 failed / 184 skipped. Running those 68 failing checks unchanged on clean main gave 67 failures and one pass. These are direct python -I tests/run_all.py results, not a successful strict mise run test run. Skips are not passes.

Of the 67 shared failures, 65 have equal normalized error signals. test_job_queue.py fails the same two assertions with different process IDs. test_sampler_admission.py reaches the same creates == 1 && live.size() == 1 assertion in different concurrent arms. The site-chain environment check still failed on both trees with the pinned compiler first on PATH; no test or compiler flags were changed to obtain a pass.

The remaining check, test_longshot_ctl.py, initially failed on the candidate and passed on main: expected a normal quit but observed an exit, followed by a log-file cleanup error. Its source and client scripts are identical between builds. A predeclared isolated repeat passed on both. The initial result remains an intermittent failure; no persistent candidate-only failure was established.

The 67 checks that also failed on clean main

All names below are under tests/:

test_alt_enter.py
test_audio_deadline.py
test_audio_output_errors.py
test_audio_wave_buffer_release.py
test_bc_levels.py
test_bind_memo.py
test_capture_copy_helpers.py
test_cheat_vm.py
test_collect_wide.py
test_coverage_run.py
test_dev_ab.py
test_dev_build.py
test_dev_migrate.py
test_dev_packs.py
test_dev_update.py
test_dlss_actor.py
test_dlss_checks.py
test_dlss_math.py
test_draw_binds.py
test_env_file.py
test_fps_overlay_order.py
test_fps_rate.py
test_fps_stats.py
test_framegen_auto.py
test_framegen_gate.py
test_fsr3_math.py
test_game_font.py
test_gpu_choice.py
test_hle_guest_ranges.py
test_import_span.py
test_job_queue.py
test_jobs_wait_runs_queued.py
test_libc_hooks.py
test_menu_mouse_scroll.py
test_mirror_inherit.py
test_movie_upscale_policy.py
test_nfc_model_info.py
test_oot_menu_mouse.py
test_parity_gates.py
test_pass_hazard.py
test_pool_span.py
test_present_ahead.py
test_prof_clock.py
test_prompt_auto_face.py
test_push_state.py
test_quick_pipelines.py
test_report_words.py
test_run_all_mingw.py
test_same_bind.py
test_same_draw.py
test_same_dyn.py
test_sampler_admission.py
test_seed_reader.py
test_setjmp_context.py
test_site_chain.py
test_skip_code.py
test_sparse_bc_usage.py
test_status_line.py
test_submitted_page.py
test_table_track.py
test_tex_spans_once_a_present.py
test_texture_layout_sizes.py
test_ub_gap.py
test_upscale_independent.py
test_upscale_label.py
test_vertex_bind.py
test_wb_pages.py

Still to test:

  • Parity gate 3 (scripts/parity_gates.py ab), which hooks.md asks of a new site: Linux-only by docs/dev/reference/parity-gates.md, so not run here, expecting the same map, positions and flags as main (by hand on a Linux machine).
  • Linux and a UTF-8 checkout path: build the changed game-host code, run the regression and enter the affected room, expecting the reset test to pass and normal room lighting (by hand on another tester's machine).
  • Windows contributor environment: investigate the named shared failures and intermittent control check, and run the strict test task with its required dependencies available (by hand).
  • Windows comparison tooling: repeat the automatic comparison after accounting for per-run control-pipe names and collecting settled area-option values, expecting a comparable-settings verdict; the current raw refusal is disclosed below (by hand).
  • Other reported locations in #886, #1305 and #2458: reproduce the reported boundary on main and repeat the route here before extending the verified fix scope (by hand).

Measurements

Verdict: The room-entry check no longer showed the corridor flicker or dark boundary. The six completed Hyrule Field runs show no speed difference beyond their spread: median 179.8 FPS on main and 179.7 here, a measured difference of −0.043%. The automatic comparison did not produce a verdict; these are manually audited measurements with the limits below.

Setup: Windows 11, RTX 5090, NVIDIA 621.40; the same private save and stationary child-Link Hyrule Field scene. Repository default comparison settings: Render 67%, frame generation off, V-Sync off, cap setting 1000. Order main, candidate, main, candidate, main, candidate; each measured window lasted 60 seconds after at least 10 seconds of warm-up. No screenshots or profiling in these six runs. All windows were warm, with zero cold frames, and all six games exited normally. Values below are measured; settings describe configuration. Summary rows are medians of three runs per build.

Measurement Before: main @ 86b3b9e4 After: this PR @ c6f30aea2
FPS, median (run range) 179.8 (179.6–180.0) 179.7 (179.5–180.4)
1% low FPS, calculated as 1000 / p99 ms 147.7 148.8
Median frame time, ms 5.54 5.54
p99 frame time, ms 6.77 6.72
Frames of 50 ms or more, median count 0 0

Individual mean FPS values from the recorded frame traces:

main-1       179.997583
candidate-1  180.360281
main-2       179.812857
candidate-2  179.457447
main-3       179.565083
candidate-3  179.735520

The unmodified dev.py ab returned 3, refusing to validate the comparison. It treats each generated HOS_CONTROL pipe name as a settings difference; comparing main's three runs against one another reproduces that refusal. It also sampled four turf labels before warm-up: one run had settled values while the others still said Load an area. All six private settings files were byte-identical, had no turf override, and their logs named the same installed Hyrule Field profile. The transient-label explanation is an inference from those records and the code; no post-warm-up option snapshot was taken. The raw refusal is preserved, with no bypass or automatic-pass claim. No performance gain is claimed.

Risks

The reset applies whenever this box-light class is acquired from the pool, including unvisited areas. A wrong hook position or constructor default could clear a legitimate owner's lighting parameters or leave an outdated transform. The hook runs before owner parameter loading, under both locks; the regression checks the order and preservation, and the earlier gameplay observer confirmed a legitimate dimmer retained its values. Other light classes are excluded.

Each acquisition of a box light performs a fixed small parameter reset; the field comparison found no speed difference beyond its spread, subject to the comparison limits above. No new switch, shader change, save migration or settings migration. Reverting the commit removes the reset. No player configuration change is required.

Checklist

Ready for review

  • One topic, on current main as tested at 86b3b9e4; the title is a Conventional Commit. Refresh upstream status before submission.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named): the named-failure exception is used here. Direct Windows runner results, skips and the intermittent check are disclosed above; no successful strict task or all-green result is claimed.
  • Measured against main, or Measurements says why there is nothing to measure. The automatic comparison's refusal is disclosed.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened: the new regression exercises the hook and callback; existing checks are unchanged.
  • Host code builds on Windows (llvm-mingw). Linux and UTF-8-path coverage remain explicitly under Still to test.
  • Screenshots of the same spot on main and here, for a change that shows on screen: three matched field pairs, two current-candidate room views and two views of the same room on main at 09dea503 with the boundary. The field pairs are lighting sanity checks, not proof of the reported field bug being fixed.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested.
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary In Ganon's Tower, defeat the two Iron Knuckles, leave their room through the corridor, then return. On the affected build, the corridor can flicker and a large dark rectangle appears across the room's floor, with a sharp straight boundary. Loading the saved corridor and walking back into the room also reproduces it. This change stops a reused box light from inheriting another light's dimming. The tested corridor and room remained normally lit after entry. Box lights come from a pool. Reuse preserves the previous owner's rotation, half-extents, blend vectors and dimming factor when the new owner has no parameter resource to replace them. The observed corner box inherited a ceiling dimmer's half-extents of 17,4,17 and factor 0.1 at its own position, darkening a 34×8×34 region. Read `game/oot_box_light.c` first, then the `light.boxAcquired` site and `tests/test_box_light_reuse.py`. The hook runs after the acquire callback, while both pool and light locks are held and before the new owner can load parameters. For the box-light class only, it restores the constructor's 52 parameter bytes and sets the transform's dirty bit. It preserves ownership, position and cached matrices; the game's transform update rebuilds the matrices, and an owner with parameters still loads them afterward. **How the cause was established** (all on this PC; the raw captures and memory reads are game-derived and stay local): - Turning Longshot's switchable changes back did not help: one run with 38 `HOS_` switches set back and one with 41 `RX_` renderer switches set back both still gave the dark room. - Setting the type-102 boxes' factor from 0.1 to 1.0 in both copies of the light records the GPU reads (checked by reading back) removed the sharp boundary, and restoring 0.1 brought it back. - The box packer reads size and factor from the box object, and a read-only sampler over the control bridge (`HOS_CONTROL_MEM=ro`) then caught the reuse described above, twice, on main. - A Switch 2 playthrough shows this room evenly lit. Why the console avoids this state is not established; the reset makes a reused box start from the game's own neutral values whatever the order. Refs #886, #1305, #2458. The gameplay result covers the corridor and two-Iron-Knuckle room; other reported locations have not been verified fixed. ## Testing **Tested:** PirateKingIsh, Windows 11, RTX 5090, NVIDIA 621.40. Built main `86b3b9e4` and candidate `c6f30aea2` with llvm-mingw clang 23.1.5 and the same translator revision; played the candidate in the room and both builds in Hyrule Field. - Before, on main at `09dea503` (nine commits before `86b3b9e4`, none of them in `game/`, `host/` or the hook-site files): the room had the dark area with a sharp straight edge in the first capture, in both door-timeline runs and in the sampler run. The sampler saw pool slots 99 and 110 go from the ceiling dimmer (half-extents 17,4,17, factor 0.1) through a released state to corner boxes with all 52 parameter bytes unchanged. Two pictures of that room on main are attached. - On the exact candidate, walked from the private corridor save into the knights' room and stood still for at least 30 seconds, then moved beside the chest. No corridor flicker was noticed and no dark square or sharp boundary was visible. Both room pictures show normal floor lighting. Render resolution was explicitly set to 100% and read back; cap 60, FPS counter on, Debug tools off. The recorded picture size was 3416×1440. - An earlier probe build, based on `09dea503a2ef` with the same reset code, recorded two real slot reuses: both returned to neutral parameters while the legitimate ceiling dimmer retained its own parameters. Those internal observations are separate from the current candidate's visual check. - Three ordinary Hyrule Field views were checked on main and candidate with matching settings, recorded positions and camera yaw. Ground lighting and shadows looked normal on both. These are checks for new lighting problems, not a reproduction or claimed fix of the field report. Navigation replay diverged; the still comparisons use the independently checked final viewpoints, not a successful-replay claim. - The new game-free regression runs the callback through the lowered hook in a synthetic pool. Main fails at `getf(i) == expected`; the candidate passes. It covers reset under both locks, later owner parameters, repeated reuse, another class, null input, the disabled site and preserved registers. All 142 existing site placements are unchanged; the candidate adds exactly one. Both full Windows builds completed with zero failed units. The changed-check collection returned **34 passed / 1 failed / 3 skipped**; `test_site_chain.py` also fails on clean main. The full candidate collection returned **609 passed / 68 failed / 184 skipped**. Running those 68 failing checks unchanged on clean main gave **67 failures and one pass**. These are direct `python -I tests/run_all.py` results, not a successful strict `mise run test` run. Skips are not passes. Of the 67 shared failures, 65 have equal normalized error signals. `test_job_queue.py` fails the same two assertions with different process IDs. `test_sampler_admission.py` reaches the same `creates == 1 && live.size() == 1` assertion in different concurrent arms. The site-chain environment check still failed on both trees with the pinned compiler first on PATH; no test or compiler flags were changed to obtain a pass. The remaining check, `test_longshot_ctl.py`, initially failed on the candidate and passed on main: expected a normal quit but observed an exit, followed by a log-file cleanup error. Its source and client scripts are identical between builds. A predeclared isolated repeat passed on both. The initial result remains an intermittent failure; no persistent candidate-only failure was established. <details> <summary>The 67 checks that also failed on clean main</summary> All names below are under `tests/`: ```text test_alt_enter.py test_audio_deadline.py test_audio_output_errors.py test_audio_wave_buffer_release.py test_bc_levels.py test_bind_memo.py test_capture_copy_helpers.py test_cheat_vm.py test_collect_wide.py test_coverage_run.py test_dev_ab.py test_dev_build.py test_dev_migrate.py test_dev_packs.py test_dev_update.py test_dlss_actor.py test_dlss_checks.py test_dlss_math.py test_draw_binds.py test_env_file.py test_fps_overlay_order.py test_fps_rate.py test_fps_stats.py test_framegen_auto.py test_framegen_gate.py test_fsr3_math.py test_game_font.py test_gpu_choice.py test_hle_guest_ranges.py test_import_span.py test_job_queue.py test_jobs_wait_runs_queued.py test_libc_hooks.py test_menu_mouse_scroll.py test_mirror_inherit.py test_movie_upscale_policy.py test_nfc_model_info.py test_oot_menu_mouse.py test_parity_gates.py test_pass_hazard.py test_pool_span.py test_present_ahead.py test_prof_clock.py test_prompt_auto_face.py test_push_state.py test_quick_pipelines.py test_report_words.py test_run_all_mingw.py test_same_bind.py test_same_draw.py test_same_dyn.py test_sampler_admission.py test_seed_reader.py test_setjmp_context.py test_site_chain.py test_skip_code.py test_sparse_bc_usage.py test_status_line.py test_submitted_page.py test_table_track.py test_tex_spans_once_a_present.py test_texture_layout_sizes.py test_ub_gap.py test_upscale_independent.py test_upscale_label.py test_vertex_bind.py test_wb_pages.py ``` </details> **Still to test:** - Parity gate 3 (`scripts/parity_gates.py ab`), which hooks.md asks of a new site: Linux-only by `docs/dev/reference/parity-gates.md`, so not run here, expecting the same map, positions and flags as main (by hand on a Linux machine). - Linux and a UTF-8 checkout path: build the changed game-host code, run the regression and enter the affected room, expecting the reset test to pass and normal room lighting (by hand on another tester's machine). - Windows contributor environment: investigate the named shared failures and intermittent control check, and run the strict test task with its required dependencies available (by hand). - Windows comparison tooling: repeat the automatic comparison after accounting for per-run control-pipe names and collecting settled area-option values, expecting a comparable-settings verdict; the current raw refusal is disclosed below (by hand). - Other reported locations in #886, #1305 and #2458: reproduce the reported boundary on main and repeat the route here before extending the verified fix scope (by hand). ## Measurements **Verdict:** The room-entry check no longer showed the corridor flicker or dark boundary. The six completed Hyrule Field runs show no speed difference beyond their spread: median 179.8 FPS on main and 179.7 here, a measured difference of −0.043%. The automatic comparison did not produce a verdict; these are manually audited measurements with the limits below. **Setup:** Windows 11, RTX 5090, NVIDIA 621.40; the same private save and stationary child-Link Hyrule Field scene. Repository default comparison settings: Render 67%, frame generation off, V-Sync off, cap setting 1000. Order main, candidate, main, candidate, main, candidate; each measured window lasted 60 seconds after at least 10 seconds of warm-up. No screenshots or profiling in these six runs. All windows were warm, with zero cold frames, and all six games exited normally. Values below are measured; settings describe configuration. Summary rows are medians of three runs per build. | Measurement | Before: main @ 86b3b9e4 | After: this PR @ c6f30aea2 | |---|---|---| | FPS, median (run range) | 179.8 (179.6–180.0) | 179.7 (179.5–180.4) | | 1% low FPS, calculated as 1000 / p99 ms | 147.7 | 148.8 | | Median frame time, ms | 5.54 | 5.54 | | p99 frame time, ms | 6.77 | 6.72 | | Frames of 50 ms or more, median count | 0 | 0 | Individual mean FPS values from the recorded frame traces: ```text main-1 179.997583 candidate-1 180.360281 main-2 179.812857 candidate-2 179.457447 main-3 179.565083 candidate-3 179.735520 ``` The unmodified `dev.py ab` returned **3**, refusing to validate the comparison. It treats each generated `HOS_CONTROL` pipe name as a settings difference; comparing main's three runs against one another reproduces that refusal. It also sampled four turf labels before warm-up: one run had settled values while the others still said `Load an area`. All six private settings files were byte-identical, had no turf override, and their logs named the same installed Hyrule Field profile. The transient-label explanation is an inference from those records and the code; no post-warm-up option snapshot was taken. The raw refusal is preserved, with no bypass or automatic-pass claim. No performance gain is claimed. ## Risks The reset applies whenever this box-light class is acquired from the pool, including unvisited areas. A wrong hook position or constructor default could clear a legitimate owner's lighting parameters or leave an outdated transform. The hook runs before owner parameter loading, under both locks; the regression checks the order and preservation, and the earlier gameplay observer confirmed a legitimate dimmer retained its values. Other light classes are excluded. Each acquisition of a box light performs a fixed small parameter reset; the field comparison found no speed difference beyond its spread, subject to the comparison limits above. No new switch, shader change, save migration or settings migration. Reverting the commit removes the reset. No player configuration change is required. ## Checklist ### Ready for review - [x] One topic, on current `main` as tested at `86b3b9e4`; the title is a Conventional Commit. Refresh upstream status before submission. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named): the named-failure exception is used here. Direct Windows runner results, skips and the intermittent check are disclosed above; no successful strict task or all-green result is claimed. - [x] Measured against `main`, or Measurements says why there is nothing to measure. The automatic comparison's refusal is disclosed. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened: the new regression exercises the hook and callback; existing checks are unchanged. - [x] Host code builds on Windows (llvm-mingw). Linux and UTF-8-path coverage remain explicitly under Still to test. - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen: three matched field pairs, two current-candidate room views and two views of the same room on main at `09dea503` with the boundary. The field pairs are lighting sanity checks, not proof of the reported field bug being fixed. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested. - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
fix(oot): a reused box light starts neutral, so it no longer keeps another light's dimming (Ganon's Castle's dark squares)
Some checks failed
PR description / Title and description (pull_request_target) Successful in 11s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
c6f30aea2a
The castle's rooms take their box lights from a pool. A slot released by one light and
taken by another keeps the old light's rotation, half-extents, blend vectors and dimming
factor unless the new owner loads its own, and a placed light without a parameter
resource loads none. In Ganon's Tower a ceiling dimmer's slot (half-extents 17,4,17,
factor 0.1) was taken by a corner box with no resource, which went on dimming the room's
lighting inside a 34 x 8 x 34 box: the dark floor with the sharp straight edge players
report, and the flicker on the corridor up to the room while slots changed hands.

light.boxAcquired runs before f_831eaa90+0x80: after the pool's acquire callback (a no-op
for boxes) and before either lock is released. It sets those 52 bytes to a new box's
values (rotation 0, half-extents 1,1,1, blend vectors 0, factor 1) and the transform's
dirty bit; an owner with parameters still loads them afterwards.

tests/test_box_light_reuse.py runs the callback behind the lowered hook in a made-up pool:
it fails on main at the stale-parameter check and passes here. In the game (Windows, RTX
5090), on main the corridor walk into the two-Iron-Knuckle room showed the slot reuse and
the dark boundary; with the reset the same reuse happened twice, both slots came back
neutral, the ceiling dimmer kept 17,4,17 / 0.1, and the room was lit with no boundary.

Refs #886, #1305, #2458

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AkPeBa76RtpdoF8gThSSue
Assisted-by: Codex
Author
Contributor

Windows 11, RTX 5090, NVIDIA 621.40. Played candidate c6f30aea2 with Render resolution explicitly set and read back at 100%, cap 60 and Debug tools off. Walked from the corridor into the two-Iron-Knuckle room in Ganon's Tower: no corridor flicker noticed and no dark square or sharp boundary visible, including beside the chest. Three matched ordinary Hyrule Field views looked normal on main 86b3b9e4 and this candidate; the field report itself was not reproduced. Six separate alternating default-settings runs measured median 179.8 FPS on main and 179.7 here. The description discloses the automatic comparison refusal, shared test failures and remaining coverage.

Windows 11, RTX 5090, NVIDIA 621.40. Played candidate c6f30aea2 with Render resolution explicitly set and read back at 100%, cap 60 and Debug tools off. Walked from the corridor into the two-Iron-Knuckle room in Ganon's Tower: no corridor flicker noticed and no dark square or sharp boundary visible, including beside the chest. Three matched ordinary Hyrule Field views looked normal on main 86b3b9e4 and this candidate; the field report itself was not reproduced. Six separate alternating default-settings runs measured median 179.8 FPS on main and 179.7 here. The description discloses the automatic comparison refusal, shared test failures and remaining coverage.
Owner
@rebase
Member

I rebased this pull request onto main (6a0636e9e7): the new head is 76608c0458.

Conflicts resolved

  • game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml: Kept both the list setup and box light acquisition locations.
  • game/sites/sites.toml: Kept both site definitions.

Nothing was built or run: read the resolution before merging.


Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

I rebased this pull request onto `main` (6a0636e9e756): the new head is 76608c0458cc. **Conflicts resolved** - game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml: Kept both the list setup and box light acquisition locations. - game/sites/sites.toml: Kept both site definitions. Nothing was built or run: read the resolution before merging. --- <sub>Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
BeanBot force-pushed fix/box-light-reuse from c6f30aea2a
Some checks failed
PR description / Title and description (pull_request_target) Successful in 11s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 76608c0458
Some checks failed
PR description / Title and description (pull_request_target) Successful in 11s
CI / Third-party parts and guide screenshots (pull_request) Failing after 21s
CI / What the change needs (pull_request) Successful in 22s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been skipped
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been skipped
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 22s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m13s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 2m28s
CI / Website build and checks (pull_request) Failing after 1m16s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 20m13s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 33m8s
2026-11-28 04:20:59 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported Windows run supports the fix for the dark boundary in the tested room, and the synthetic regression exercises the reset. The new hook affects box lights throughout the game, so Linux and broader gameplay coverage remain before merge. Recommend approval; not approved on the forge.

Resets recycled box-light parameters to neutral before the next owner loads its parameters, preventing a previous owner's dimming from carrying over. The change is small and targeted, but applies to box-light acquisitions in areas beyond the reported room.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L1 game/oot_box_light.c:18: The reset applies to every acquisition of this box-light class, while gameplay coverage is limited to one Windows NVIDIA system and a few locations. (more on the line) Do: Run the affected route and representative box-lit areas on Linux and the remaining applicable Tier 1 systems, and complete hook parity gate 3; record the results before merge.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes for the reported room on the tested Windows PC: the boundary appeared on main and was not visible on the candidate. Three alternating Hyrule Field runs per build measured median 179.8 versus 179.7 FPS, within their spread; the automatic settings comparison refused the runs, so that performance comparison has limits.

Other systems: The hook runs on worker threads under the game’s pool and light locks and affects box-light acquisitions in all areas. Windows gameplay was checked on NVIDIA; Linux, other Tier 1 hardware and additional affected locations remain untested. The fixture does not model game resource loading, scheduling or rendering.

Switches: None added, changed or removed.

Reviewed: 76608c0458 against 6a0636e9e7: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards and relevant hook documentation; the full diff and commit; game/oot_box_light.c and tests/test_box_light_reuse.py in full; and the changed site entries and surrounding hook registration and test helpers. Skimmed the remaining portions of the large site tables, hook documentation and test helpers. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The callback preserves the other dirty-flag bits and excludes other vtables.
  • The regression invokes the lowered hook, checks later owner parameters and fails on the baseline for stale parameters.
  • The commit records AI assistance, and no game-derived output or generated file is included in the diff.

Testing: No code or tests were run during this review. The author reports the targeted Windows gameplay run, baseline and candidate regression results, shared test failures and an intermittent control-check failure. CI is still running, and the pull request reports mergeable as false.

Overlaps and merge order: Not checked; network access is unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The reported Windows run supports the fix for the dark boundary in the tested room, and the synthetic regression exercises the reset. The new hook affects box lights throughout the game, so Linux and broader gameplay coverage remain before merge. Recommend approval; not approved on the forge. Resets recycled box-light parameters to neutral before the next owner loads its parameters, preventing a previous owner's dimming from carrying over. The change is small and targeted, but applies to box-light acquisitions in areas beyond the reported room. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1** `game/oot_box_light.c:18`: The reset applies to every acquisition of this box-light class, while gameplay coverage is limited to one Windows NVIDIA system and a few locations. (more on the line) **Do:** Run the affected route and representative box-lit areas on Linux and the remaining applicable Tier 1 systems, and complete hook parity gate 3; record the results before merge. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported room on the tested Windows PC: the boundary appeared on main and was not visible on the candidate. Three alternating Hyrule Field runs per build measured median 179.8 versus 179.7 FPS, within their spread; the automatic settings comparison refused the runs, so that performance comparison has limits. **Other systems:** The hook runs on worker threads under the game’s pool and light locks and affects box-light acquisitions in all areas. Windows gameplay was checked on NVIDIA; Linux, other Tier 1 hardware and additional affected locations remain untested. The fixture does not model game resource loading, scheduling or rendering. **Switches:** None added, changed or removed. **Reviewed:** 76608c0458cc against 6a0636e9e756: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards and relevant hook documentation; the full diff and commit; game/oot_box_light.c and tests/test_box_light_reuse.py in full; and the changed site entries and surrounding hook registration and test helpers. Skimmed the remaining portions of the large site tables, hook documentation and test helpers. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The callback preserves the other dirty-flag bits and excludes other vtables. - The regression invokes the lowered hook, checks later owner parameters and fails on the baseline for stale parameters. - The commit records AI assistance, and no game-derived output or generated file is included in the diff. **Testing:** No code or tests were run during this review. The author reports the targeted Windows gameplay run, baseline and candidate regression results, shared test failures and an intermittent control-check failure. CI is still running, and the pull request reports mergeable as false. **Overlaps and merge order:** Not checked; network access is unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.</sub>
@ -0,0 +15,4 @@
/* Rotation, half-extents, the two blend vectors and the dimming factor.
Keep identity, ownership, position and the cached matrices; dirty bit 0
makes the game's transform update rebuild those matrices. */
for (unsigned off = 580; off < 632; off += 4)
Member

L1 (should fix): The reset applies to every acquisition of this box-light class, while gameplay coverage is limited to one Windows NVIDIA system and a few locations.

When: A box light in an unvisited area can be reused with parameters or transform behavior different from the tested castle lights; the synthetic fixture assumes the owner-loading order and cannot show the resulting lighting.

Do: Run the affected route and representative box-lit areas on Linux and the remaining applicable Tier 1 systems, and complete hook parity gate 3; record the results before merge.

**L1** (should fix): The reset applies to every acquisition of this box-light class, while gameplay coverage is limited to one Windows NVIDIA system and a few locations. *When:* A box light in an unvisited area can be reused with parameters or transform behavior different from the tested castle lights; the synthetic fixture assumes the owner-loading order and cannot show the resulting lighting. **Do:** Run the affected route and representative box-lit areas on Linux and the remaining applicable Tier 1 systems, and complete hook parity gate 3; record the results before merge.
HumanBean deleted branch fix/box-light-reuse 2026-11-28 04:22:28 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2666
No description provided.