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

Closed
opened 2026-11-26 05:40:52 +00:00 by github-bot · 1 comment
Owner

@⁠KainanP on GitHub · 2026-11-25 22:21 UTC · original

Follow-up to #252, as asked in #252. #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.

**@⁠KainanP** on GitHub · 2026-11-25 22:21 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/262) Follow-up to #252, as asked in https://git.gtahub.st/github/LooperSalty--AnyXboxX/pulls/252. #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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:40:53 +00:00
Author
Owner

@⁠KainanP on GitHub · 2026-11-25 23:26 UTC · original

#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).

**@⁠KainanP** on GitHub · 2026-11-25 23:26 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/262#issuecomment-7177554789) #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)._
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/LooperSalty--AnyXboxX#262
No description provided.