Remaining Leonida references: rdna2_image.py credits, cfg_structure import in rdna2_hlsl.py, rdna2_spirv.py #262

Closed
opened 2026-11-25 22:21:51 +00:00 by KainanP · 1 comment
KainanP commented 2026-11-25 22:21:51 +00:00 (Migrated from github.com)
Contributor

Imported from LooperSalty/AnyXboxX. Originally posted by KainanP on 2026-11-25T22:21:51Z.


Follow-up to #252, as asked in https://github.com/LooperSalty/AnyXboxX/pull/252#issuecomment-7175501717. #252 re-sources the Leonida citations in the typed-buffer and 16-bit compare files, which came from #150 and #226. The references below remain on main (9a06443). They do not cite Leonida's measurements. They credit Leonida's code or tables, or they call the frozen translator in third_party/leonida. Each of the three files has other authors (git blame), so #252 does not touch them.

File Lines What it is
PrototypeScarlett/emu/rdna2_image.py 6-9 T#/S# field positions credited to Leonida's runtime/src/gfx10_descriptors.h (GPL-3.0, itself after Mesa's src/amd/registers/gfx10-rsrc.json, MIT), format names from data/gfx10_formats.json (Leonida)
PrototypeScarlett/emu/rdna2_hlsl.py 5, 288-290 control-flow structuring through third_party/leonida/cfg_structure.py (imported at run time)
PrototypeScarlett/emu/rdna2_spirv.py 1-5, 22, 57-117 the second RDNA 2 → SPIR-V translator, which calls third_party/leonida/rdna2spirv.py

Done when:

  • (#252) rdna2_image.py cites Mesa's src/amd/registers/gfx10-rsrc.json (MIT) or the AMD RDNA 2 ISA (section 8.2.6 "Image Resource") for each descriptor field and for the format names, instead of Leonida;
  • rdna2_hlsl.py no longer imports third_party/leonida/cfg_structure.py (an own structuring pass, or the existing while + switch (pc) fallback), with the HLSL parity tests still passing on RTX, WARP and Intel UHD;
  • the maintainer decides whether rdna2_spirv.py (the SPIR-V path) stays, as code credited in THIRD_PARTY.md, or goes.

Removing the code dependency belongs in its own PR, as suggested on #252. I can take the first two items if you want.

AI assistance: written with Claude Code (Claude Opus 5.5) for KainanP.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:6614954301 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/issues/262). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T22:21:51Z. --- Follow-up to #252, as asked in https://github.com/LooperSalty/AnyXboxX/pull/252#issuecomment-7175501717. #252 re-sources the Leonida citations in the typed-buffer and 16-bit compare files, which came from #150 and #226. The references below remain on `main` (`9a06443`). They do not cite Leonida's measurements. They credit Leonida's code or tables, or they call the frozen translator in `third_party/leonida`. Each of the three files has other authors (`git blame`), so #252 does not touch them. | File | Lines | What it is | | --- | --- | --- | | `PrototypeScarlett/emu/rdna2_image.py` | 6-9 | T#/S# field positions credited to Leonida's `runtime/src/gfx10_descriptors.h` (GPL-3.0, itself after Mesa's `src/amd/registers/gfx10-rsrc.json`, MIT), format names from `data/gfx10_formats.json` (Leonida) | | `PrototypeScarlett/emu/rdna2_hlsl.py` | 5, 288-290 | control-flow structuring through `third_party/leonida/cfg_structure.py` (imported at run time) | | `PrototypeScarlett/emu/rdna2_spirv.py` | 1-5, 22, 57-117 | the second RDNA 2 → SPIR-V translator, which calls `third_party/leonida/rdna2spirv.py` | Done when: - [x] (#252) `rdna2_image.py` cites Mesa's `src/amd/registers/gfx10-rsrc.json` (MIT) or the AMD RDNA 2 ISA (section 8.2.6 "Image Resource") for each descriptor field and for the format names, instead of Leonida; - [ ] `rdna2_hlsl.py` no longer imports `third_party/leonida/cfg_structure.py` (an own structuring pass, or the existing `while` + `switch (pc)` fallback), with the HLSL parity tests still passing on RTX, WARP and Intel UHD; - [ ] the maintainer decides whether `rdna2_spirv.py` (the SPIR-V path) stays, as code credited in THIRD_PARTY.md, or goes. Removing the code dependency belongs in its own PR, as suggested on #252. I can take the first two items if you want. AI assistance: written with Claude Code (Claude Opus 5.5) for KainanP.
KainanP commented 2026-11-25 23:26:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LooperSalty/AnyXboxX. Originally posted by KainanP on 2026-11-25T23:26:06Z.


#252 now covers the first item. rdna2_image.py cites the RDNA 2 ISA, §8.2.6-8.2.8 (tables 45-47), plus Mesa's SQ_TEX_BORDER_COLOR enum for the border colour values, which table 46 doesn't give. #252 also changes the comments in rdna2_hlsl.py and rdna2_spirv.py to describe the code in third_party/leonida/ as frozen GPL-3.0 code, not as a measurement source.

This issue stays open for the other two items: removing the cfg_structure import from rdna2_hlsl.py, and your decision on rdna2_spirv.py.

Two more places still cite a Leonida measurement: runtime/d3d12_xs/virtual_memory.cpp (lines 9-13, "Mesure de Leonida … #6750") and tests/test_d3d12_virtual_memory.py (line 6). That is your code, so I left it alone. It could cite our own measurement of the call on the executable instead, or say "assumed".

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7177554789 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/issues/262#issuecomment-7177554789). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T23:26:06Z. --- #252 now covers the first item. `rdna2_image.py` cites the RDNA 2 ISA, §8.2.6-8.2.8 (tables 45-47), plus Mesa's `SQ_TEX_BORDER_COLOR` enum for the border colour values, which table 46 doesn't give. #252 also changes the comments in `rdna2_hlsl.py` and `rdna2_spirv.py` to describe the code in `third_party/leonida/` as frozen GPL-3.0 code, not as a measurement source. This issue stays open for the other two items: removing the `cfg_structure` import from `rdna2_hlsl.py`, and your decision on `rdna2_spirv.py`. Two more places still cite a Leonida measurement: `runtime/d3d12_xs/virtual_memory.cpp` (lines 9-13, "Mesure de Leonida … #6750") and `tests/test_d3d12_virtual_memory.py` (line 6). That is your code, so I left it alone. It could cite our own measurement of the call on the executable instead, or say "assumed". _AI use: Claude Code (Claude Opus 5.5)._
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
LooperSalty/AnyXboxX#262
No description provided.