bvh: shaders reach title memory itself by address (VICTORY_BVH_IN_PLACE=1) #11

Closed
github-bot wants to merge 1 commit from github-bot/gh-11 into main AGit
Owner

@⁠luisaugustz on GitHub · 2026-11-29 17:05 UTC · original
luisaugustz:bvh-in-place → main · +86 −6 · 1 files · 1 commits · closed without merging

Follow-up to #8.

With unified memory, shaders that read title memory by address use it in place instead of through copies: the directory entries of those pages name views of the unified-memory mirror, so there is nothing to compare or send for them. Off unless VICTORY_BVH_IN_PLACE=1. The new views are numbered below the card pages' slots, so the two do not collide. The =vram mode is left out.

Testing

RX 9070 XT, Arch, 5a60834 plus this commit, 2560x1440, software ray tracing (VICTORY_BVH_BUILDER=1), same save and view:

flag off flag on
fps 8.9 32.7
CPU time keeping copies about 76 ms per frame 0
  • Both of those runs ended in a gfx ring timeout (about 80 s into the world with the flag on, about 2.5 min with it off). My card had a -30 mV undervolt at the time.
  • At stock voltage, one later run with the flag on went about 11.5 minutes in the world, moving around, without a hang (32.2 fps median while standing at the same spot). One run does not show it is stable, and I did not repeat the flag-off run.
  • The flag-off run also reached the fault page limit, so its picture may not be directly comparable.
  • Shaders now write title memory directly, so this has had much less play time than the copy path.

The ray tracing lighting bug is separate and still there.

🤖 Generated with Claude Code

**@⁠luisaugustz** on GitHub · 2026-11-29 17:05 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/11) `luisaugustz:bvh-in-place` → `main` · +86 −6 · 1 files · 1 commits · closed without merging Follow-up to #8. With unified memory, shaders that read title memory by address use it in place instead of through copies: the directory entries of those pages name views of the unified-memory mirror, so there is nothing to compare or send for them. Off unless `VICTORY_BVH_IN_PLACE=1`. The new views are numbered below the card pages' slots, so the two do not collide. The `=vram` mode is left out. ## Testing RX 9070 XT, Arch, `5a60834` plus this commit, 2560x1440, software ray tracing (`VICTORY_BVH_BUILDER=1`), same save and view: | | flag off | flag on | |---|---|---| | fps | 8.9 | 32.7 | | CPU time keeping copies | about 76 ms per frame | 0 | - Both of those runs ended in a gfx ring timeout (about 80 s into the world with the flag on, about 2.5 min with it off). My card had a -30 mV undervolt at the time. - At stock voltage, one later run with the flag on went about 11.5 minutes in the world, moving around, without a hang (32.2 fps median while standing at the same spot). One run does not show it is stable, and I did not repeat the flag-off run. - The flag-off run also reached the fault page limit, so its picture may not be directly comparable. - Shaders now write title memory directly, so this has had much less play time than the copy path. The ray tracing lighting bug is separate and still there. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With unified memory, the directory entries of pages read by address name views
of the unified-memory mirror instead of copies, so there is nothing to compare
or send for those pages. Stretches of 128 MiB are numbered below the card's
pages. Off unless asked for.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 07:41:08 +00:00
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:00 UTC · original · edited 2026-12-05 11:24 UTC

As I read it, this is already in main: this feature is in main under different names.

crates/victory-gpu/src/memory.rs:154 pub(crate) fn in_place(), with STRETCH/STRETCHES/STRETCH_TOP at :133-136, fn put_in_place, crate::um::mirror_over, and the WHOLE/let_go alias machinery — all added in the same commit (2773fdf) that removed the sibling borrow-recording switch. The bounds check (k < self.copies.len()) is in main too.

There is no defect in the patch; it is the ancestor of what shipped, so rebasing it into that code would be a regression to an older shape.

If you think the shipped put_in_place/mirror_over version lost something this one had, say so on the merged commit — that is more useful than a rebase.

Whether it still has work of its own is the maintainer's call, not mine.

**@⁠Luxuride** on GitHub · 2026-12-04 12:00 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/11#issuecomment-7410835715) · edited 2026-12-05 11:24 UTC As I read it, this is already in `main`: this feature is in `main` under different names. `crates/victory-gpu/src/memory.rs:154` `pub(crate) fn in_place()`, with `STRETCH`/`STRETCHES`/`STRETCH_TOP` at `:133-136`, `fn put_in_place`, `crate::um::mirror_over`, and the `WHOLE`/`let_go` alias machinery — all added in the same commit (`2773fdf`) that removed the sibling borrow-recording switch. The bounds check (`k < self.copies.len()`) is in `main` too. There is no defect in the patch; it is the ancestor of what shipped, so rebasing it into that code would be a regression to an older shape. If you think the shipped `put_in_place`/`mirror_over` version lost something this one had, say so on the merged commit — that is more useful than a rebase. Whether it still has work of its own is the maintainer's call, not mine.
github-bot closed this pull request 2026-12-05 17:31:37 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.