chore(build): RX_SOFT_WRITE_WATCH and LONGSHOT_OCCLUSION_OFF removed: the soft write watch and the game's occlusion queries, as by default #573

Merged
HumanBean merged 1 commit from HumanBean/Longshot:chore/remove-two-switches into main 2026-11-14 20:22:16 +00:00
Owner

Why

Two build/run switches were left over from past measurements and experiments, and the owner's sweep of build switches (2026-11-14: sensible defaults, no knobs) removes them. Nothing changes for players: both already did nothing unless set, and their default is now the only behaviour.

What changed

  • build: RX_SOFT_WRITE_WATCH is gone from nx2/build.py. WRITE_TRACK is always -DA64_WRITE_TRACK (the soft write watch, rt/a64.h A64_MARK), as it was unless RX_SOFT_WRITE_WATCH=0 was set. The flags are the same as today's default, so the object keys don't change.
  • host: reserve_guest() in host/hos_main.c no longer has the MEM_WRITE_WATCH branch that only a build without A64_WRITE_TRACK took. On Windows the guest window is reserved without a write watch, as it already was in every default build.
  • lift: nx2/oot_occlusion.py (Fritchii's Occlusion Off) and its import in nx2/lift.py are gone. With LONGSHOT_OCCLUSION_OFF unset it only added if (hos_occlusion_off) c->x[8] = 0; after six of the game's instructions, and that flag was 0, so it did nothing. hos_occlusion_off and occlusion_switch() in host/hos_main.c are gone too. The game makes its occlusion queries as before, and the Vulkan replay answers them (RX_VK_OCC_*, unchanged).
  • docs: the LONGSHOT_OCCLUSION_OFF=1 line is gone from docs/development.md's switch reference. RX_SOFT_WRITE_WATCH had no entry there.
  • tests: the new tests/test_switches_removed.py checks that neither switch (nor hos_occlusion_off) is read anywhere in nx2/, host/, gpu/, scripts/, builder/ or docs/, that WRITE_TRACK is always on, that nx2/oot_occlusion.py stays gone and that hos_main.c no longer asks for MEM_WRITE_WATCH. No existing check read the removed code.

Flags and settings

Flag What it does Default now Recommendation Helps on Doesn't help on Untested on
RX_SOFT_WRITE_WATCH (removed) =0 built with Windows' write watch instead of the soft one Soft write watch, always Removed: the =0 path was ~20 ms a scan and ~12 ms of replay wait a frame n/a n/a n/a
LONGSHOT_OCCLUSION_OFF (removed) =1 made the game skip its occlusion queries The game makes its queries, always Removed: an experiment from before the replay answered the queries n/a n/a n/a

Neither is a player option: no menu row, options-file key or launcher setting reads them.

Measurements

None. Default behaviour is unchanged: the build flags are the same as today's default, and the removed lift patch did nothing with its switch unset. Being a build and source cleanup, it is measured by its game-free checks.

main: 7ff5256e (2026-11-14)
this PR: chore/remove-two-switches @ 32bbfabc

Testing

Tested: Nothing was run on this PC: no build, no game, no checks. CI runs tests/run_all.py.

Not tested: A run in the game. The only difference from main's default build is that the six occlusion-switch sites are lifted without the no-op check, and that a Windows build reserves the guest window as it already did by default.

Needs other testers: None.

Screenshots

Nothing on screen.

Risk and rollback

  • One-time re-translation: nx2/lift.py changed and nx2/oot_occlusion.py is gone. Both are lift sources (make_game.py lift_sources()), so the lift key changes once and the next build translates the game again. The lifted C of the six functions with the occlusion sites changes too (the no-op check is gone), so their objects are compiled again. The game-code flags are the same, so the other objects stay cached. host/hos_main.c changed, so that one runtime file is compiled again.
  • If something breaks, reverting the commit is enough. Nothing else depends on the removed code.
  • Not changed here on purpose: the GetWriteWatch fallbacks in gpu/render/ (rx_buffer.cpp) and host/rx_backend.c's #else (rx_collect_written) belong to the WebGPU renderer, which is being removed in a parallel PR. hos.h's no-op HOS_WRITTEN (#else) stays because the checks compile host files without A64_WRITE_TRACK. third_party/a64-kit/rt/a64.h still names RX_SOFT_WRITE_WATCH=0 in a comment, which can't be edited here (tree-sha256).

Reviewer notes

Start with reserve_guest() in host/hos_main.c: the HOS_LARGE_PAGES branch was already inside the A64_WRITE_TRACK case, so every build keeps it.

Issues

None.

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above). (not run here: left to CI)
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (nothing to measure: default behaviour unchanged, and the game-free checks are left to CI)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Flags noted, and the switch reference updated (docs/development.md, the README).
  • A game-free test added for the fix, failing on main and passing here (read off the diff: main still reads both switches; not run here).
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (not built here: left to CI. The change is a removed #if branch and a removed function)
  • Docs updated.

🤖 Generated with Claude Code

## Why Two build/run switches were left over from past measurements and experiments, and the owner's sweep of build switches (2026-11-14: sensible defaults, no knobs) removes them. Nothing changes for players: both already did nothing unless set, and their default is now the only behaviour. ## What changed - build: `RX_SOFT_WRITE_WATCH` is gone from `nx2/build.py`. `WRITE_TRACK` is always `-DA64_WRITE_TRACK` (the soft write watch, `rt/a64.h` `A64_MARK`), as it was unless `RX_SOFT_WRITE_WATCH=0` was set. The flags are the same as today's default, so the object keys don't change. - host: `reserve_guest()` in `host/hos_main.c` no longer has the `MEM_WRITE_WATCH` branch that only a build without `A64_WRITE_TRACK` took. On Windows the guest window is reserved without a write watch, as it already was in every default build. - lift: `nx2/oot_occlusion.py` (Fritchii's Occlusion Off) and its import in `nx2/lift.py` are gone. With `LONGSHOT_OCCLUSION_OFF` unset it only added `if (hos_occlusion_off) c->x[8] = 0;` after six of the game's instructions, and that flag was 0, so it did nothing. `hos_occlusion_off` and `occlusion_switch()` in `host/hos_main.c` are gone too. The game makes its occlusion queries as before, and the Vulkan replay answers them (`RX_VK_OCC_*`, unchanged). - docs: the `LONGSHOT_OCCLUSION_OFF=1` line is gone from docs/development.md's switch reference. `RX_SOFT_WRITE_WATCH` had no entry there. - tests: the new `tests/test_switches_removed.py` checks that neither switch (nor `hos_occlusion_off`) is read anywhere in nx2/, host/, gpu/, scripts/, builder/ or docs/, that `WRITE_TRACK` is always on, that `nx2/oot_occlusion.py` stays gone and that `hos_main.c` no longer asks for `MEM_WRITE_WATCH`. No existing check read the removed code. ## Flags and settings | Flag | What it does | Default now | Recommendation | Helps on | Doesn't help on | Untested on | |---|---|---|---|---|---|---| | `RX_SOFT_WRITE_WATCH` (removed) | `=0` built with Windows' write watch instead of the soft one | Soft write watch, always | Removed: the `=0` path was ~20 ms a scan and ~12 ms of replay wait a frame | n/a | n/a | n/a | | `LONGSHOT_OCCLUSION_OFF` (removed) | `=1` made the game skip its occlusion queries | The game makes its queries, always | Removed: an experiment from before the replay answered the queries | n/a | n/a | n/a | Neither is a player option: no menu row, options-file key or launcher setting reads them. ## Measurements None. Default behaviour is unchanged: the build flags are the same as today's default, and the removed lift patch did nothing with its switch unset. Being a build and source cleanup, it is measured by its game-free checks. main: 7ff5256e (2026-11-14) this PR: chore/remove-two-switches @ 32bbfabc ## Testing **Tested:** Nothing was run on this PC: no build, no game, no checks. CI runs `tests/run_all.py`. **Not tested:** A run in the game. The only difference from main's default build is that the six occlusion-switch sites are lifted without the no-op check, and that a Windows build reserves the guest window as it already did by default. **Needs other testers:** None. ## Screenshots Nothing on screen. ## Risk and rollback - **One-time re-translation:** `nx2/lift.py` changed and `nx2/oot_occlusion.py` is gone. Both are lift sources (`make_game.py` `lift_sources()`), so the lift key changes once and the next build translates the game again. The lifted C of the six functions with the occlusion sites changes too (the no-op check is gone), so their objects are compiled again. The game-code flags are the same, so the other objects stay cached. `host/hos_main.c` changed, so that one runtime file is compiled again. - If something breaks, reverting the commit is enough. Nothing else depends on the removed code. - Not changed here on purpose: the `GetWriteWatch` fallbacks in `gpu/render/` (`rx_buffer.cpp`) and `host/rx_backend.c`'s `#else` (`rx_collect_written`) belong to the WebGPU renderer, which is being removed in a parallel PR. `hos.h`'s no-op `HOS_WRITTEN` (`#else`) stays because the checks compile host files without `A64_WRITE_TRACK`. `third_party/a64-kit/rt/a64.h` still names `RX_SOFT_WRITE_WATCH=0` in a comment, which can't be edited here (tree-sha256). ## Reviewer notes Start with `reserve_guest()` in `host/hos_main.c`: the `HOS_LARGE_PAGES` branch was already inside the `A64_WRITE_TRACK` case, so every build keeps it. ## Issues None. ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [ ] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). (not run here: left to CI) - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [ ] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (nothing to measure: default behaviour unchanged, and the game-free checks are left to CI) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Flags noted, and the switch reference updated (docs/development.md, the README). - [x] A game-free test added for the fix, failing on `main` and passing here (read off the diff: main still reads both switches; not run here). - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (not built here: left to CI. The change is a removed `#if` branch and a removed function) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore(build): RX_SOFT_WRITE_WATCH and LONGSHOT_OCCLUSION_OFF removed: the soft write watch and the game's occlusion queries, as by default
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Third-party parts / As their notes say (pull_request) Successful in 9s
beanstalk/approval awaiting maintainer approval
PR description / Description follows the template (pull_request_target) Failing after 14s
32bbfabc02
RX_SOFT_WRITE_WATCH=0 built with Windows' write watch instead of the soft one; the soft write watch
is now always built in and the guest window is never write-watched (hos_main.c reserve_guest).
LONGSHOT_OCCLUSION_OFF=1 made the game skip its occlusion queries; unset, nx2/oot_occlusion.py only
added a check of a flag that was never set, so the patch, its import and the host flag go.
tests/test_switches_removed.py checks that neither is read any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from WIP: chore(build): RX_SOFT_WRITE_WATCH and LONGSHOT_OCCLUSION_OFF removed: the soft write watch and the game's occlusion queries, as by default to chore(build): RX_SOFT_WRITE_WATCH and LONGSHOT_OCCLUSION_OFF removed: the soft write watch and the game's occlusion queries, as by default 2026-11-14 20:22:08 +00:00
HumanBean deleted branch chore/remove-two-switches 2026-11-14 20:22:17 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!573
No description provided.