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

Open
opened 2026-11-28 01:54:01 +00:00 by github-bot · 4 comments
Owner

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

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 #461 (which leaves image dwords 5-7 refused on purpose), #411 (a buffer's stride or swizzle) and #389/#387 (buffer fields).

**@⁠Olima34** on GitHub · 2026-11-28 01:51 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540) 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 #461 (which leaves image dwords 5-7 refused on purpose), #411 (a buffer's stride or swizzle) and #389/#387 (buffer fields).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 01:54:02 +00:00
Author
Owner

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

/claim

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

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

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

**@⁠github-actions[bot]** on GitHub · 2026-11-28 01:51 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540#issuecomment-7231967230) Claimed by @⁠Olima34. Open a draft pull request with `Refs #540` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠jamal-fv on GitHub · 2026-11-28 21:30 UTC · original

Heads-up: I opened #645 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 #645 to the next free reason. Otherwise I will implement the host-answerable dword-5 fields (MAX_MIP / array pitch from getDimensions) here under #645 and close this as duplicate when the PR lands.

**@⁠jamal-fv** on GitHub · 2026-11-28 21:30 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540#issuecomment-7246066601) Heads-up: I opened #645 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 #645 to the next free reason. Otherwise I will implement the host-answerable dword-5 fields (`MAX_MIP` / array pitch from `getDimensions`) here under #645 and close this as duplicate when the PR lands.
Author
Owner

@⁠jamal-fv on GitHub · 2026-11-28 21:51 UTC · original

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

**@⁠jamal-fv** on GitHub · 2026-11-28 21:51 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/540#issuecomment-7246324067) Partial landing under #645 / draft PR: dword 5 rebuilt; dwords 6–7 still refused. Happy to hand off or leave 6–7 to you.
This discussion has been locked. Commenting is limited to contributors.
No description provided.