GPU: publish numeric descriptor bases in 16-byte view-address records #3468

Open
github-bot wants to merge 2 commits from github-bot/gh-3468 into main AGit
Owner

@⁠rezioliver-collab on GitHub · 2026-11-27 04:03 UTC · original
talleyrand222:codex/2091-descriptor-record → main · +304 −56 · 5 files · 2 commits · open

This is the runtime prerequisite for #2091. It lets a shader read a descriptor’s numeric base while preserving the existing 16-byte view-address record at t1. Review and merge this change first.

Operation Expected result
Buffer view Word 0 holds the low 32 bits of the guest byte address, including the first-element offset. An ordinary buffer-pointer load still returns the byte address.
Image view Word 0 holds guest byte-address bits 39:8. Width, height, mip and type fields keep their existing meanings.
CBV Word 0 holds the low 32 bits of the guest byte address.
Buffer-pointer load from an image or CBV Returns two zero words. The host-only tag stays hidden from shader-visible fields.
Clear a reused slot Clears all four words before the next view is written.

For example, guest byte address 0x12_3456_7800 gives buffer word 0 0x34567800 and image word 0 0x12345678. AMD specifies those address units. The four-word host table, the CBV mapping and the null-pointer convention belong to VIctory. AMD RDNA 2 ISA, §8.1.8 table 37 and §8.2.6 table 45

The D3D12 slot-reuse test reads back two adjacent records after each write. The neighboring CBV must retain all four words while the first slot changes from image to clear to buffer. A separate shader test exercises numeric and pointer reads. Its DXIL container parsed on this commit on M1.

On an Apple M1 with Rust 1.98.1, the shader suite passed (175 passed, 3 ignored), as did the targeted Clippy checks and repository policy check. The workspace formatting check also fails on the upstream base.

Windows hardware verification: upipibi ran all three targeted tests on an RTX 3070 (driver 616.56) on 3c979791, whose files match PR head e9f2a68. D3D12 readback matched both adjacent 16-byte slots after image, clear and buffer writes. The shader’s numeric view-address and pointer reads matched on hardware and WARP. Independent Windows log.

The earlier RTX 3070 run verified two 16-byte slots on the combined head 7a110d9. The older RTX 5080 experiment used the 8-byte staging layout from closed #2048. The validator work in #1065 remains separate.

AI-assisted with OpenAI Codex.

**@⁠rezioliver-collab** on GitHub · 2026-11-27 04:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/3468) `talleyrand222:codex/2091-descriptor-record` → `main` · +304 −56 · 5 files · 2 commits · open This is the runtime prerequisite for #2091. It lets a shader read a descriptor’s numeric base while preserving the existing 16-byte view-address record at `t1`. Review and merge this change first. | Operation | Expected result | | --- | --- | | Buffer view | Word 0 holds the low 32 bits of the guest byte address, including the first-element offset. An ordinary buffer-pointer load still returns the byte address. | | Image view | Word 0 holds guest byte-address bits 39:8. Width, height, mip and type fields keep their existing meanings. | | CBV | Word 0 holds the low 32 bits of the guest byte address. | | Buffer-pointer load from an image or CBV | Returns two zero words. The host-only tag stays hidden from shader-visible fields. | | Clear a reused slot | Clears all four words before the next view is written. | For example, guest byte address `0x12_3456_7800` gives buffer word 0 `0x34567800` and image word 0 `0x12345678`. AMD specifies those address units. The four-word host table, the CBV mapping and the null-pointer convention belong to VIctory. [AMD RDNA 2 ISA, §8.1.8 table 37 and §8.2.6 table 45](https://docs.amd.com/v/u/en-US/rdna2-shader-instruction-set-architecture) The D3D12 slot-reuse test reads back two adjacent records after each write. The neighboring CBV must retain all four words while the first slot changes from image to clear to buffer. A separate shader test exercises numeric and pointer reads. Its DXIL container parsed on this commit on M1. On an Apple M1 with Rust 1.98.1, the shader suite passed (175 passed, 3 ignored), as did the targeted Clippy checks and repository policy check. The workspace formatting check also fails on the upstream base. **Windows hardware verification:** upipibi ran all three targeted tests on an RTX 3070 (driver 616.56) on `3c979791`, whose files match PR head `e9f2a68`. D3D12 readback matched both adjacent 16-byte slots after image, clear and buffer writes. The shader’s numeric view-address and pointer reads matched on hardware and WARP. [Independent Windows log](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2091). The [earlier RTX 3070 run](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2091) verified two 16-byte slots on the combined head `7a110d9`. The [older RTX 5080 experiment](https://github.com/talleyrand222/VIctory/commit/fa89bb652278b700f190335523d759f9476e7ea6) used the 8-byte staging layout from closed #2048. The validator work in #1065 remains separate. AI-assisted with OpenAI Codex.
Keep image metadata and buffer pointer loads distinct. Test slot reuse, numeric image and CBV reads, and hide the host-only tag from shader-visible fields. Keep Windows-only validator calls guarded in native unit tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 04:04:14 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-27 09:46 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head e9f2a68 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 868 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: descriptor_base_word_tracks_the_guest_view_address, a_reused_title_slot_publishes_the_native_base_word.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-27 09:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/3468#issuecomment-7215083091) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `e9f2a68` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **868 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `descriptor_base_word_tracks_the_guest_view_address`, `a_reused_title_slot_publishes_the_native_base_word`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request can be merged automatically.
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/3468/head:github-bot/gh-3468'
git switch 'github-bot/gh-3468'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3468'
git switch 'github-bot/gh-3468'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3468'
git switch 'github-bot/gh-3468'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3468'
git switch 'main'
git merge --squash 'github-bot/gh-3468'
git switch 'main'
git merge --ff-only 'github-bot/gh-3468'
git switch 'main'
git merge 'github-bot/gh-3468'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3468
No description provided.