docs: re-source the Leonida citations in the RDNA 2 code and credit the frozen Leonida translators #252
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!252
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-252"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KainanP on GitHub · 2026-11-25 21:34 UTC · original
KainanP:docs/leonida-citations-in-tree→main· +73 −49 · 9 files · 2 commits · openChange
Follow-up to the review of #230, #232 and #235, and to the review of this PR. The Leonida docs (
ubiquitarianism/leonidadocs/design.md) were taken down on 2026-11-24 after a DMCA notice, and rule 2 asks for AMD's ISA, LLVM's tests, Microsoft Learn or our own measurements. This PR handles every Leonida reference listed in the review: citations of Leonida measurements are re-sourced or labelled assumed, and code taken from Leonida is credited as frozen GPL-3.0 code. Comments and THIRD_PARTY.md only; no behaviour change.AMD's RDNA 2 ISA below is the November 2020 reference guide (Wayback copy, SHA-256
22aec03f…, seedocs/research/rdna2-sources.md); page numbers are the printed ones.emu/rdna2_exec_cmp16.py(#226): inline floats on 16-bit integer sources now cite LLVM 20.1.8,Utils/AMDGPUBaseInfo.cppgetInlineEncodingV216("for UI16 instructions: corresponding single-precision float value"), andtest/CodeGen/AMDGPU/add.v2i16.ll, where GFX10 encodes<0, 16256>as1.0. The SDWA case is labelled assumed. Both stay requested in akimfomin/PortBridge#83.emu/rdna2_buffer_format.pyandemu/rdna2_exec_format.py(#150):emu/rdna2_hlsl_format.py: theBufUnormcomment states the identity it uses (m / (2^n − 1) = 0.mmm… in base 2^n) instead of naming Leonida.tests/test_rdna2_exec_format.py: one comment.emu/rdna2_image.py: each T#/S# field the code reads cites section 8.2.6, table 45 (p. 75) and section 8.2.7, table 46 (p. 76-77); format codes cite section 8.2.8, table 47 (p. 78-79). Every position and value in the code matches the tables. Table 46 names the border colour types without values, so 0/1/2 = transparent black / opaque black / opaque white cite Mesa'sSQ_TEX_BORDER_COLORenum (src/amd/registers/gfx6.json, MIT, read statically). The positions were first ported from Leonida'sgfx10_descriptors.h(GPL-3.0), which stays credited.data/gfx10_formats.jsonstays credited as a copy of Leonida's table; it is identical to Mesa'sGFX10_FORMATenum (gfx10-rsrc.json), and the 105 codes in table 47 have the same names there.emu/rdna2_hlsl.py(cfg_structureimport) andemu/rdna2_spirv.py: the comments creditcfg_structure.pyandrdna2spirv.pyas frozen, unmodified GPL-3.0 copies inthird_party/leonida/(commit1cc6e3c121, THIRD_PARTY.md), a code dependency rather than a source of measurements. Whatrdna2_spirv.pysays about the translator's inputs is read from that code. The import and the SPIR-V path are unchanged: removing the code dependency is #262, as you suggested.THIRD_PARTY.md:rdna2_hlsl.pyis listed as importingcfg_structure.py; the typed-memory row no longer says "measured by Leonida"; the Leonida and Mesa descriptor rows say what the code now cites.Overlap: #230 also edits
rdna2_buffer_format.pyandrdna2_exec_format.py(different lines). Whichever PR merges second gets a small rebase.Verification
On
main3e258c8:ISA tables 45-47 and Mesa
gfx10-rsrc.json/gfx6.jsonwere compared with the code by a script (field positions, enum values, and the 160 format names). There is no behaviour change, so no new test.Checklist
E_NOTIMPL), never a fake success.test_readme_sync.pychecks it). (No README change.)Made with AI assistance: Claude Code with Claude Opus 5.5, for KainanP.
🤖 Generated with Claude Code
@LooperSalty on GitHub · 2026-11-25 21:45 UTC · original
Thanks for taking this on. Some Leonida references remain outside the files this PR touches:
rdna2_buffer_format.py(lines 18-27, 163, 258),rdna2_exec_format.py(7-18),rdna2_hlsl_format.py(49),rdna2_image.py(6-9),rdna2_hlsl.py(5, 288-290) andrdna2_spirv.py(1-5, 22, 57-117, code that importsthird_party/leonida), andtests/test_rdna2_exec_format.py(157). Could you re-source these to AMD's RDNA 2 ISA, LLVM's tests or our own measurements (saying how each was obtained), or narrow this PR's title to the files it covers and open a follow-up for the rest? Removing the code dependency onthird_party/leonidacan be a separate PR.@KainanP on GitHub · 2026-11-25 22:22 UTC · original
Updated (one commit,
50edfe1, rebased on main9a06443):rdna2_buffer_format.py(18-27, 163, 258) andrdna2_exec_format.py(7-18): Leonida is gone. MTBUF format and selectors, the INVALID format, SEL_1 out of range and the all-or-nothing range check now cite AMD's RDNA 2 ISA, §8.1.4 table 31 (p. 59) and §8.1.5 notes 1 and 3 (p. 62). The UNORM rounding, 16-bit FLOAT NaN widening, integer store saturation and the 1.0/1 value of SEL_1 are labelled assumed. DST_SEL_Z = Z/W stores stay refused, because nothing documents them.rdna2_hlsl_format.py(49): the comment states the identity it uses instead of naming Leonida.tests/test_rdna2_exec_format.py(157): comment reworded.rdna2_image.py,rdna2_hlsl.py(cfg_structureimport) andrdna2_spirv.pyare other contributors' code and a code dependency, so they are listed in follow-up issue #262.AI use: Claude Code (Claude Opus 5.5).
@KainanP on GitHub · 2026-11-25 23:25 UTC · original
Updated: rebased on main
3e258c8, with a new commit6fb5569on top of18a7bc0. The PR now covers every file in your list, so I widened the title again.rdna2_buffer_format.py,rdna2_exec_format.py,rdna2_hlsl_format.py,tests/test_rdna2_exec_format.py: unchanged since my last reply (RDNA 2 ISA §8.1.4/§8.1.5, or labelled assumed).rdna2_image.py(6-9): each T#/S# field now cites the RDNA 2 ISA, §8.2.6 table 45 (p. 75) and §8.2.7 table 46 (p. 76-77). The format codes cite §8.2.8 table 47 (p. 78-79). Every position and value in the code matches these tables. Table 46 gives no values for the border colour types, so 0/1/2 cite Mesa'sSQ_TEX_BORDER_COLORenum (gfx6.json, MIT). Leonida'sgfx10_descriptors.hand the copiedgfx10_formats.jsonstay credited as GPL-3.0 code and data. The JSON is identical to Mesa'sGFX10_FORMATenum.rdna2_hlsl.py(5, 288-290) andrdna2_spirv.py(1-5, 22, 57-117): the comments now describecfg_structure.pyandrdna2spirv.pyas frozen, unmodified GPL-3.0 copies inthird_party/leonida/(credited in THIRD_PARTY.md), not as a measurement source. The import and the SPIR-V path are unchanged; as you suggested, removing that dependency is left to #262.THIRD_PARTY.md: listsrdna2_hlsl.pyas importingcfg_structure.py, and no longer says "measured by Leonida".No behaviour change. Nothing new is labelled assumed in this round. Full suite on the RTX: 1404 passed, 17 skipped. Ruff passes.
AI use: Claude Code (Claude Opus 5.5).
@LooperSalty on GitHub · 2026-11-26 00:06 UTC · original
Thanks for starting this. Rule 2 needs the Leonida references gone, and 224 remain on this branch (242 on main), including live imports of
third_party/leonida:PrototypeScarlett/emu/rdna2_hlsl.py:288-294and:358,emu/rdna2_spirv.py:62-64,scarlett.py:287,tests/test_rdna2_hlsl_cfg.py:3, plus the THIRD_PARTY rows andsite/index.html. Could you rewrite it so the code no longer importsthird_party/leonida(replace or drop the paths that need it, with tests), re-source the remaining claims to AMD's RDNA 2 ISA, LLVM's tests or our own measurements (saying how each was obtained), and remove the folder and its credits? Splitting it into a code PR and a docs PR is fine.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.