Title memory by address: the structure builder turns off when no copy number is left (#1257) #1265

Open
github-bot wants to merge 1 commit from github-bot/gh-1265 into main AGit
Owner

@⁠Humb8l on GitHub · 2026-11-26 05:29 UTC · original
Humb8l:fix/memory-copies-builder-off-1257 → main · +48 −9 · 2 files · 1 commits · open

Refs #1257.

What happened

With VICTORY_BVH_BUILDER=1, memory.rs ran out of its 1023 copy numbers within seconds. It logged no number left for another copy; its pages read zeros once and kept running the builder. The builder's stages then read zeros and dropped stores. The module itself treats that as a dropped stage ("all or none"). The title then faulted in its own image (0xc0000005).

Change

  • memory::ready returns Ready::whole. It is false when a page named by this dispatch found no number left.
  • In State::bind, a builder stage for which whole is false is dropped, and pipeline::builder_off(...) is called. A stage that cannot be bound already takes this path. Programs outside the builder are unchanged.
  • The one-time warning now counts the copies numbered so far by what named them first: views, pairs, units (constants in 256-byte units) and faults. The reporter's hypothesis is that constants are being taken for addresses. The next run of the log will confirm it or rule it out before anyone touches the heuristic in ready.

This does not make the builder work: it stops it cleanly instead of letting the title crash. The root cause (why so many copies are numbered) is left for the measurement above.

Checks

  • cargo clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings: OK
  • cargo test --locked -p victory-gpu --lib memory: 15 passed
  • Not run in the game: I don't have the hardware. A run with VICTORY_BVH_BUILDER=1 should now show the ray-tracing structure builder is turned off for the rest of the run right after the no number left warning, and no crash.

🤖 Generated with Claude Code

**@⁠Humb8l** on GitHub · 2026-11-26 05:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/1265) `Humb8l:fix/memory-copies-builder-off-1257` → `main` · +48 −9 · 2 files · 1 commits · open Refs #1257. ## What happened With `VICTORY_BVH_BUILDER=1`, `memory.rs` ran out of its 1023 copy numbers within seconds. It logged `no number left for another copy; its pages read zeros` once and **kept running the builder**. The builder's stages then read zeros and dropped stores. The module itself treats that as a dropped stage ("all or none"). The title then faulted in its own image (`0xc0000005`). ## Change - `memory::ready` returns `Ready::whole`. It is `false` when a page named by this dispatch found no number left. - In `State::bind`, a **builder** stage for which `whole` is `false` is dropped, and `pipeline::builder_off(...)` is called. A stage that cannot be bound already takes this path. Programs outside the builder are unchanged. - The one-time warning now counts the copies numbered so far by what named them first: `views`, `pairs`, `units` (constants in 256-byte units) and `faults`. The reporter's hypothesis is that constants are being taken for addresses. The next run of the log will confirm it or rule it out before anyone touches the heuristic in `ready`. This does not make the builder work: it stops it cleanly instead of letting the title crash. The root cause (why so many copies are numbered) is left for the measurement above. ## Checks - `cargo clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings`: OK - `cargo test --locked -p victory-gpu --lib memory`: 15 passed - **Not run in the game**: I don't have the hardware. A run with `VICTORY_BVH_BUILDER=1` should now show `the ray-tracing structure builder is turned off for the rest of the run` right after the `no number left` warning, and no crash. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With VICTORY_BVH_BUILDER=1 the 1023 copy numbers ran out within seconds
and the builder kept running with stages whose pages read zeros, which
the module itself calls a dropped stage; the title then faulted in its
own image. A dispatch whose named pages found no number now returns
`whole: false` from `memory::ready`, and a builder stage in that case is
dropped and turns the builder off, as a stage that cannot be bound does.

The one-time warning now counts the copies numbered so far by what
named them first (root views, constant pairs, constants in 256-byte
units, fault notes), to tell whether constants taken for addresses are
what uses the numbers up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:07:21 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1265/head:github-bot/gh-1265'
git switch 'github-bot/gh-1265'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1265'
git switch 'github-bot/gh-1265'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1265'
git switch 'github-bot/gh-1265'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1265'
git switch 'main'
git merge --squash 'github-bot/gh-1265'
git switch 'main'
git merge --ff-only 'github-bot/gh-1265'
git switch 'main'
git merge 'github-bot/gh-1265'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.