GPU: cache exact buffer span unions per heap #1413

Open
github-bot wants to merge 5 commits from github-bot/gh-1413 into main AGit
Owner

@⁠spk-c on GitHub · 2026-11-26 23:55 UTC · original
spk-c:submit/descriptor-buffer-spans-v2 → main · +1604 −1430 · 16 files · 5 commits · open

AI-assisted selective adaptation of Kelvaroq 0055 via spk-c/victory-fork#41; source attribution in docs.

Opt-in VICTORY_DESCRIPTOR_BUFFER_SPANS=1 retains the exact enclosing range per backing buffer in the unmarked heap pass. The authoritative slot map, 16-pass revalidation cadence, dirty drain and existing refresh semantics remain unchanged. The index is discarded on inconsistency, full scans, marked-pass reset and heap destruction. The existing marked pass is unchanged. Two CPU oracle tests exercise mixed updates and duplicate endpoints.

This targets span aggregation rather than the descriptor mirroring, lock, and allocation changes of #1293/#1400. No gameplay improvement claimed. Original fork CI passed; direct upstream CI is pending.

Dependencies: existing #1372 (stable heap IDs and cache cleanup, original commit 9aac3495) and #1357 (test extraction, original commit 450ed9bd). Both are separate, attributed ancestors, not new feature changes. Asset-policy checks and size limit unchanged. When the original dependency commits are merged normally, their changes disappear from this diff.

**@⁠spk-c** on GitHub · 2026-11-26 23:55 UTC · [original](https://github.com/fxceless/victory-fork/pull/1413) `spk-c:submit/descriptor-buffer-spans-v2` → `main` · +1604 −1430 · 16 files · 5 commits · open AI-assisted selective adaptation of Kelvaroq 0055 via spk-c/victory-fork#41; source attribution in docs. Opt-in VICTORY_DESCRIPTOR_BUFFER_SPANS=1 retains the exact enclosing range per backing buffer in the unmarked heap pass. The authoritative slot map, 16-pass revalidation cadence, dirty drain and existing refresh semantics remain unchanged. The index is discarded on inconsistency, full scans, marked-pass reset and heap destruction. The existing marked pass is unchanged. Two CPU oracle tests exercise mixed updates and duplicate endpoints. This targets span aggregation rather than the descriptor mirroring, lock, and allocation changes of #1293/#1400. No gameplay improvement claimed. Original fork CI passed; direct upstream CI is pending. Dependencies: existing #1372 (stable heap IDs and cache cleanup, original commit 9aac3495) and #1357 (test extraction, original commit 450ed9bd). Both are separate, attributed ancestors, not new feature changes. Asset-policy checks and size limit unchanged. When the original dependency commits are merged normally, their changes disappear from this diff.
The check job fails on main: crates/victory-gpu/src/host.rs (528,954 bytes)
and crates/victory-shader/src/emit/lower.rs (535,588 bytes) are over the
asset policy's 512 KiB limit (#1342).

Only #[cfg(test)] modules move, verbatim apart from losing one level of
indentation; module names and paths are unchanged, no non-test code changes.

- host.rs: its eight test modules (tests, relay_tests, grouped_tests,
  late_tests, trail, spare, batch, queue2_tests) move to host/<name>.rs,
  the layout profile.rs and profile/tests.rs already use. 492,495 bytes.
- lower.rs: mod tests moves to emit/lower_tests.rs, declared with
  #[path = "lower_tests.rs"] as in #1322. 512,559 bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015kFDn6faAxnJwPKPwiCnj1
AI-assisted adaptation to upstream stable heap IDs and marked-pass cache; no cadence changes.
AI-assisted selective adaptation of Kelvaroq 0055 via fork #41; preserves upstream scan cadence and depends on stable heap lifetime fix #1372.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:03:50 +00:00
Author
Owner

@⁠akimfomin on GitHub · 2026-11-27 00:14 UTC · original

Your span cache combines cleanly with KyleS98's table-slot experiment at the current VIctory base. I used Git merge-tree with your head 900c15f5 and #1414 head 9a18dd08. It produced tree a38ce19426925cab2511eb6685c305103dba86b6. I also checked your head with #1411 at dee3f61a; the result was tree f36574568a84b3183368c4756c4d7f914887797d. Both are merge checks, with no behavioral or timing result.

If you compare both descriptor changes, keep the four switch combinations separate. Record the refreshed spans per backing buffer as well as frame time. That will show whether marking more table-owned slots reduces the work your cache is trying to aggregate. You can give a future public PR/target pair to your agent through PortBridge #98 and attach the exact result there for another fork. AI-assisted Git check.

**@⁠akimfomin** on GitHub · 2026-11-27 00:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/1413#issuecomment-7206299541) Your span cache combines cleanly with KyleS98's table-slot experiment at the current VIctory base. I used Git merge-tree with your head `900c15f5` and #1414 head `9a18dd08`. It produced tree `a38ce19426925cab2511eb6685c305103dba86b6`. I also checked your head with #1411 at `dee3f61a`; the result was tree `f36574568a84b3183368c4756c4d7f914887797d`. Both are merge checks, with no behavioral or timing result. If you compare both descriptor changes, keep the four switch combinations separate. Record the refreshed spans per backing buffer as well as frame time. That will show whether marking more table-owned slots reduces the work your cache is trying to aggregate. You can give a future public PR/target pair to your agent through [PortBridge #98](https://github.com/akimfomin/PortBridge/issues/98) and attach the exact result there for another fork. AI-assisted Git check.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-shader/src/emit/lower_tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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