Repository navigation
docs: measure the RDNA2 opcode funnel behind the iOS question - #100
Open
xiaotu030202 wants to merge 1 commit into
Open
xiaotu030202 wants to merge 1 commit into
xiaotu030202 wants to merge 1 commit into
Conversation
Issue Zettrox#83 asks whether an iOS / Metal target is in scope. The answer turns on how much of the shader backend is pinned by tests and how much a second backend would have to reproduce unproven, which nothing in the tree states. Counted, not estimated: gfx10/opcodes.rs 1,232 opcodes named emit/lower.rs 333 named by the lowering emit/*_tests.rs 89 named by a test Both of the smaller numbers are upper bounds (naming an opcode is not handling it, and a test can name one in a comment), so the document bounds the funnel rather than claiming exact figures, and says what would make it exact: a `victory translate --list` sweep over the shader corpus, which needs game files. The point it makes for the issue: the tests are the only part of the backend that carries over to Metal unchanged, so a second backend is validated on roughly a quarter of the surface it must cover, and the rest has to be right by construction. That is why the estimate is "replace the back half of lower.rs" rather than "add an emitter". No code changed. Text only, in docs/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #83, as promised in my comment there: the opcode inventory, measured from the tree rather than estimated.
→
docs/rdna2-coverage.md(this PR, text only, no code)The funnel
gfx10/opcodes.rsemit/lower.rs*_tests.rsfilesWhy I think it is worth a document
The tests are the only part of the shader backend that carries over to a Metal backend unchanged —
diff_tests.rscompares against the console SDK's owndxc.exe, and thevalu/wave64/intersectsuites pin RDNA2 results a second backend would have to reproduce. If 89 opcodes are pinned and 333 are lowered, then a second backend can be validated on roughly a quarter of the surface it has to cover, and the remaining 244 have to be right by construction.That is what makes the estimate "replace the back half of
lower.rs" rather than "add an emitter": you cannot lean on the tests for the rest.Both counts are upper bounds, and the document says so
Naming an opcode in
lower.rsis not the same as handling it — many arematcharms passing through a shared helper, and a few appear only in atracingmessage. A test can name one in a comment. So the doc bounds the funnel and states what would make it exact:over the 26,503-shader corpus, which needs game files. I do not have them; a tester or you do. The document's step 2 is to turn that into an opcode-frequency table, because the top of it is very likely far below 244 — game shaders use a small subset heavily.
What this PR is not
Not a claim that iOS is feasible or infeasible. It is the one part of the #83 decision that can be settled from the repository alone, plus an explicit list of what cannot (the MSL leg needs a Mac; the x64-without-JIT problem needs an AOT recompiler, which is a different project).
Verification
cargo test --workspaceon this tree is green on my machine — 0 failures, so nothing here fixes a bug. Windows 11, RTX 5070 Ti, Rust 1.98.1 pinned, MSVC 14.44.35207, Windows SDK 10.0.26100.0.The document is a single new file under
docs/; no existing file is touched, and the asset-policy check is unaffected (text,.md).