Descriptor table entries are mirrored at submission, so a dispatch can see an entry the title changed after recording it #542

Open
opened 2026-11-28 01:42:41 +00:00 by github-bot · 2 comments
Owner

@⁠Olima34 on GitHub · 2026-11-28 01:40 UTC · original

What happens

The host copies (mirrors) a descriptor table entry when the work is submitted, not when the draw or dispatch is recorded. GTA VI changes entries of its big shared table (root slot 0, entries 8 to 251) between recording a dispatch and submitting it: bind, dispatch, unbind. So the earlier dispatch runs with the later record.

Measured

300 s windowed world runs on the preview branch (b3c1a1b0), Series S, M5 Pro, counting the entries each compute shader's table ranges reach:

run entry uses rewritten before the earlier dispatch was submitted changed between record and submission
1 7.66 million 258 128
2 13.56 million 256 18

Examples (ids only):

  • compute 3d7ddd732c89db9f was recorded with a 2,048-byte constant buffer at entry 251, and a null constant buffer was there at submission (3 times);
  • a96ed16c68231d2d was recorded with a texture view at entry 82, and f50436bfbc651bc5 then has a null view there;
  • 98dc84d373234c59 was recorded with a null view at entry 48, and a placed buffer view was there at submission.

Many other differences are the same placed view with other padding words (1 and 13); those are harmless.

Not seen: an entry holding two records for two commands of one submission (0), or an entry rewritten with older work in flight (0). Only dispatches were counted, not draws.

What would fix it

Keep the bound entries' records with the command when it is recorded, instead of reading the table at submission. It's small in count, but a dispatch that reads a null constant buffer instead of its real one computes garbage.

**@⁠Olima34** on GitHub · 2026-11-28 01:40 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/538) ### What happens The host copies (mirrors) a descriptor table entry when the work is **submitted**, not when the draw or dispatch is **recorded**. GTA VI changes entries of its big shared table (root slot 0, entries 8 to 251) between recording a dispatch and submitting it: bind, dispatch, unbind. So the earlier dispatch runs with the later record. ### Measured 300 s windowed world runs on the preview branch (`b3c1a1b0`), Series S, M5 Pro, counting the entries each compute shader's table ranges reach: | run | entry uses | rewritten before the earlier dispatch was submitted | changed between record and submission | |---|---|---|---| | 1 | 7.66 million | 258 | 128 | | 2 | 13.56 million | 256 | 18 | Examples (ids only): - compute `3d7ddd732c89db9f` was recorded with a 2,048-byte constant buffer at entry 251, and a null constant buffer was there at submission (3 times); - `a96ed16c68231d2d` was recorded with a texture view at entry 82, and `f50436bfbc651bc5` then has a null view there; - `98dc84d373234c59` was recorded with a null view at entry 48, and a placed buffer view was there at submission. Many other differences are the same placed view with other padding words (1 and 13); those are harmless. Not seen: an entry holding two records for two commands of one submission (0), or an entry rewritten with older work in flight (0). Only dispatches were counted, not draws. ### What would fix it Keep the bound entries' records with the command when it is recorded, instead of reading the table at submission. It's small in count, but a dispatch that reads a null constant buffer instead of its real one computes garbage.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 01:42:41 +00:00
Author
Owner

@⁠Sheffy007 on GitHub · 2026-11-28 01:48 UTC · original

/claim

**@⁠Sheffy007** on GitHub · 2026-11-28 01:48 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/538#issuecomment-7231925531) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 01:48 UTC · original

Claimed by @⁠Sheffy007. Open a draft pull request with Refs #538 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 01:48 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/538#issuecomment-7231927744) Claimed by @⁠Sheffy007. Open a draft pull request with `Refs #538` in its description within 24 hours, or the claim expires.
This discussion has been locked. Commenting is limited to contributors.
No description provided.