Shader: compute programs read an image descriptor's dwords 5 to 7 as data (200 shaders, 85 dropped passes per world frame) #540

Open
opened 2026-11-28 01:51:35 +00:00 by Olima34 · 4 comments
Olima34 commented 2026-11-28 01:51:35 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:51:35Z.


On main, compute programs that read an image descriptor's dwords 5 to 7 as numbers are refused with "a descriptor's address or format read as data: an image's dwords 5 to 7". The descriptor is one the program also uses as an image, so it goes through Lower::descriptor_data, which rebuilds dwords 1-4 from the host view's getDimensions and leaves 5-7 without a value.

Weight. In a census of 5 world frames (main 86cefd22 plus 8 open PRs), it is the second-largest loss: 84.8 dropped compute passes per frame, 50 world programs, 200 containers of a 21,600-shader world corpus (plus 8 graphics containers not bound in those frames).

Plan.

  • Find which fields of dwords 5-7 these programs read and what they compute from them. On GFX10, dword 5 holds the array pitch and the last mip level (max_mip), dwords 6-7 compression and metadata bits and the metadata address.
  • Give the fields the host view can answer (from getDimensions, as dwords 1-4 already are), and keep a precise refusal for the ones it can't (the metadata address, compression state). Guesses marked in the code and in docs/native-host.md.
  • Unit tests for the lowering; a Metal value test if the lowering reads real data.
  • A by-output corpus sweep before and after in the pull request; 0 regressions.

Next to #457 (which leaves image dwords 5-7 refused on purpose), #407 (a buffer's stride or swizzle) and #386/#387 (buffer fields).

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6657436696 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-28T01:51:35Z. --- On main, compute programs that read an image descriptor's dwords 5 to 7 as numbers are refused with "a descriptor's address or format read as data: an image's dwords 5 to 7". The descriptor is one the program also uses as an image, so it goes through `Lower::descriptor_data`, which rebuilds dwords 1-4 from the host view's `getDimensions` and leaves 5-7 without a value. **Weight.** In a census of 5 world frames (main 86cefd22 plus 8 open PRs), it is the second-largest loss: 84.8 dropped compute passes per frame, 50 world programs, 200 containers of a 21,600-shader world corpus (plus 8 graphics containers not bound in those frames). **Plan.** - Find which fields of dwords 5-7 these programs read and what they compute from them. On GFX10, dword 5 holds the array pitch and the last mip level (`max_mip`), dwords 6-7 compression and metadata bits and the metadata address. - Give the fields the host view can answer (from `getDimensions`, as dwords 1-4 already are), and keep a precise refusal for the ones it can't (the metadata address, compression state). Guesses marked in the code and in `docs/native-host.md`. - Unit tests for the lowering; a Metal value test if the lowering reads real data. - A by-output corpus sweep before and after in the pull request; 0 regressions. Next to #457 (which leaves image dwords 5-7 refused on purpose), #407 (a buffer's stride or swizzle) and #386/#387 (buffer fields).
Olima34 commented 2026-11-28 01:51:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:51:36Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231965252 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540#issuecomment-7231965252). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-28T01:51:36Z. --- /claim
github-actions[bot] commented 2026-11-28 01:51:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T01:51:47Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231967230 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540#issuecomment-7231967230). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T01:51:47Z. --- Claimed by @Olima34. Open a draft pull request with `Refs #540` in its description within 24 hours, or the claim expires.
jamal-fv commented 2026-11-28 21:30:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by jamal-fv on 2026-11-28T21:30:19Z.


Heads-up: I opened #641 for the next-000367 census (image dwords 5–7 is the largest descriptor refusal there) and claimed it. Your claim on this issue has no PR yet; if you are actively writing one, say so and I will leave this class to you and pivot #641 to the next free reason. Otherwise I will implement the host-answerable dword-5 fields (MAX_MIP / array pitch from getDimensions) here under #641 and close this as duplicate when the PR lands.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7246066601 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540#issuecomment-7246066601). Originally posted by [jamal-fv](https://github.com/jamal-fv) on 2026-11-28T21:30:19Z. --- Heads-up: I opened #641 for the next-000367 census (image dwords 5–7 is the largest descriptor refusal there) and claimed it. Your claim on this issue has no PR yet; if you are actively writing one, say so and I will leave this class to you and pivot #641 to the next free reason. Otherwise I will implement the host-answerable dword-5 fields (`MAX_MIP` / array pitch from `getDimensions`) here under #641 and close this as duplicate when the PR lands.
jamal-fv commented 2026-11-28 21:51:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by jamal-fv on 2026-11-28T21:51:28Z.


Partial landing under #641 / draft PR: dword 5 rebuilt; dwords 6–7 still refused. Happy to hand off or leave 6–7 to you.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7246324067 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540#issuecomment-7246324067). Originally posted by [jamal-fv](https://github.com/jamal-fv) on 2026-11-28T21:51:28Z. --- Partial landing under #641 / draft PR: dword 5 rebuilt; dwords 6–7 still refused. Happy to hand off or leave 6–7 to you.
Sign in to join this conversation.
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
LakshanSivakumar/Native-Victory-macOS#540
No description provided.