GPU and shaders: publish bounded descriptor size metadata #1969

Open
thatirishguyyy wants to merge 2 commits from upstream-pr/1971 into main
thatirishguyyy commented 2026-11-25 01:59:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by thatirishguyyy on 2026-11-25T01:59:05Z.


Follow-up to #1067. Size-only shader queries can read descriptor metadata from the host heap. The runtime supplies supported size, view type, and mip fields from the actual view. Existing buffer addresses are preserved, deferred views are populated at first bind, and out-of-range slots resolve to a zero row.

Validation

  • On 940d32f6, both tracked PS_PuddleDetect variants emit DXIL and pass the Windows SDK validator. Three host metadata tests and the synthetic shader readback passed on WARP, including slot rewrites, clearing, and out-of-range reads.
  • On the earlier 170ab232 base, the bounded prototype added 36 DXIL-valid shaders and lost none across 26,096 programs.
  • World rendering and AMD hardware stability remain unverified for this branch.

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6595393674 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971). Originally posted by [thatirishguyyy](https://github.com/thatirishguyyy) on 2026-11-25T01:59:05Z. --- Follow-up to #1067. Size-only shader queries can read descriptor metadata from the host heap. The runtime supplies supported size, view type, and mip fields from the actual view. Existing buffer addresses are preserved, deferred views are populated at first bind, and out-of-range slots resolve to a zero row. **Validation** - On `940d32f6`, both tracked `PS_PuddleDetect` variants emit DXIL and pass the Windows SDK validator. Three host metadata tests and the synthetic shader readback passed on WARP, including slot rewrites, clearing, and out-of-range reads. - On the earlier `170ab232` base, the bounded prototype added 36 DXIL-valid shaders and lost none across 26,096 programs. - World rendering and AMD hardware stability remain unverified for this branch. AI-assisted with Codex.
upipibi commented 2026-11-25 02:06:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T02:05:41Z.


Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 1ae8ad3. victory-shader: 244 passed, with only #1744's 3 NVIDIA failures. victory-gpu: 144 passed, 2 failed, with only the two NVIDIA heap-cap failures main also has (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views). Same as main on this hardware. Not run: a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150309848 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#issuecomment-7150309848). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T02:05:41Z. --- Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `1ae8ad3`. `victory-shader`: 244 passed, with only #1744's 3 NVIDIA failures. `victory-gpu`: 144 passed, 2 failed, with only the two NVIDIA heap-cap failures `main` also has (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`). Same as `main` on this hardware. Not run: a title. AI-assisted (Claude Code).
catminou4 commented 2026-11-25 03:03:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:10:34Z.

Review: COMMENTED


Mixed PR: victory-shader part macOS-tested in batch queue; victory-gpu part Windows-only static.

Publish bounded descriptor size metadata (gpu+shader): shader half macOS-tested separately, GPU half Windows-only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6050614176 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#pullrequestreview-6050614176). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T02:10:34Z. **Review:** COMMENTED --- Mixed PR: victory-shader part macOS-tested in batch queue; victory-gpu part Windows-only static. Publish bounded descriptor size metadata (gpu+shader): shader half macOS-tested separately, GPU half Windows-only.
thatirishguyyy commented 2026-11-25 03:03:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by thatirishguyyy on 2026-11-25T02:11:38Z.


Exact-base follow-up: comparing 940d32f6 with PR head 1ae8ad32 across 26,096 programs, this PR adds 36 DXIL-valid shaders with zero validation regressions and clears all 36 descriptor read only as data refusals.

If anyone already reaches the prologue on a working build, could you run a paired comparison from the same checkpoint, with #1971 as the only code change? Please report the base commit or PR stack, GPU and driver, whether visible draws or effects change in the same scene, and whether either run hangs. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150426779 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#issuecomment-7150426779). Originally posted by [thatirishguyyy](https://github.com/thatirishguyyy) on 2026-11-25T02:11:38Z. --- Exact-base follow-up: comparing `940d32f6` with PR head `1ae8ad32` across 26,096 programs, this PR adds 36 DXIL-valid shaders with zero validation regressions and clears all 36 `descriptor read only as data` refusals. If anyone already reaches the prologue on a working build, could you run a paired comparison from the same checkpoint, with #1971 as the only code change? Please report the base commit or PR stack, GPU and driver, whether visible draws or effects change in the same scene, and whether either run hangs. AI-assisted.
DesertGamer commented 2026-11-25 03:03:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-25T02:17:28Z.


VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150539810 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#issuecomment-7150539810). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-25T02:17:28Z. --- ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
catminou4 commented 2026-11-25 04:06:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:32:25Z.

Review: APPROVED


Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, cargo test -p victory-shader --locked.

144 passed / 0 failed / 2 ignored. Publish bounded descriptor size metadata — shader half verified here (144 green); the victory-gpu half is Windows-only and was staticked separately. Bounded metadata prevents oversized descriptor tables.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051456058 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#pullrequestreview-6051456058). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T03:32:25Z. **Review:** APPROVED --- Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, `cargo test -p victory-shader --locked`. 144 passed / 0 failed / 2 ignored. Publish bounded descriptor size metadata — shader half verified here (144 green); the victory-gpu half is Windows-only and was staticked separately. Bounded metadata prevents oversized descriptor tables.
akimfomin commented 2026-11-25 04:06:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by akimfomin on 2026-11-25T03:20:59Z.


Thatirishguyyy, PortBridge connected the exact 1ae8ad326 metadata writer and production upload allocation to a small independent HLSL readback through D3D12 root SRV t1, space2. On an RTX 4070 Ti SUPER all 80 output words matched across four fenced submissions: a deferred 36×22 array view, a rewrite to 18×11 on the same table address, a separate heap's two rows, and the original table after clearing. Both out-of-range indices returned zero every time.

Exact source construction and sanitized raw native words. This checks the real metadata allocation and writer with fixture-owned heap selection. The production shader translator's lowering and a title run remain outside this check. The fixture did not request the D3D12 debug layer. AI-assisted PortBridge verification (OpenAI Codex).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151830780 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#issuecomment-7151830780). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-25T03:20:59Z. --- Thatirishguyyy, [PortBridge](https://github.com/akimfomin/PortBridge) connected the exact `1ae8ad326` metadata writer and production upload allocation to a small independent HLSL readback through D3D12 root SRV `t1, space2`. On an RTX 4070 Ti SUPER all 80 output words matched across four fenced submissions: a deferred 36×22 array view, a rewrite to 18×11 on the same table address, a separate heap's two rows, and the original table after clearing. Both out-of-range indices returned zero every time. [Exact source construction and sanitized raw native words](https://github.com/akimfomin/PortBridge/blob/ea79193b5271a146da3e8506f470b83b12207db1/research/rendering-night/victory-1971-metadata/README.md). This checks the real metadata allocation and writer with fixture-owned heap selection. The production shader translator's lowering and a title run remain outside this check. The fixture did not request the D3D12 debug layer. AI-assisted PortBridge verification (OpenAI Codex).
zed6000 commented 2026-11-25 05:06:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zed6000 on 2026-11-25T04:23:33Z.


Measured offline on the title's shaders (the method in #1247): merged onto main 940d32f (a clean merge) and compared program by program (victory translate --validate --list, shaders.rpf 1.0.2.1, dxil.dll 1.8.2502).

+36 programs, 0 lost. All 36 failed on main with "a descriptor read only as data", so this PR clears that reason on this title completely. It also merges cleanly together with #1989, #1065 and #1883: the four together give +1,683 programs and 0 lost, and cargo test -p victory-shader --lib passes (252/0) on an RX 7900 XTX. Offline counts only; no program names or data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152800603 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#issuecomment-7152800603). Originally posted by [zed6000](https://github.com/zed6000) on 2026-11-25T04:23:33Z. --- Measured offline on the title's shaders (the method in #1247): merged onto main `940d32f` (a clean merge) and compared program by program (`victory translate --validate --list`, `shaders.rpf` 1.0.2.1, dxil.dll 1.8.2502). **+36 programs, 0 lost.** All 36 failed on main with "a descriptor read only as data", so this PR clears that reason on this title completely. It also merges cleanly together with #1989, #1065 and #1883: the four together give +1,683 programs and 0 lost, and `cargo test -p victory-shader --lib` passes (252/0) on an RX 7900 XTX. Offline counts only; no program names or data.
Marvisak commented 2026-11-25 09:06:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:25:47Z.


Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-gpu/src/descriptor/host.rs, crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/memory_tests.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (needs work) was for an older state of main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157014194 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1971#issuecomment-7157014194). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T08:25:47Z. --- <!-- victory-triage v1 head=1ae8ad326ef6b4fe6e5ac1c5555079fafb78575a verdict=needs-rebase at=2026-11-25T16:18:00Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-gpu/src/descriptor/host.rs`, `crates/victory-shader/src/emit/lower.rs`, `crates/victory-shader/src/emit/memory_tests.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (needs work) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1971:upstream-pr/1971'
git switch 'upstream-pr/1971'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1971'
git switch 'upstream-pr/1971'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1971'
git switch 'upstream-pr/1971'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1971'
git switch 'main'
git merge --squash 'upstream-pr/1971'
git switch 'main'
git merge --ff-only 'upstream-pr/1971'
git switch 'main'
git merge 'upstream-pr/1971'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Marvisak/VIctory!1969
No description provided.