tooling: decode past s_endpgm with after_endpgm field #1062

Manually merged
github merged 3 commits from gh-pr/1062/head into gh-pr/1062/base 2026-11-26 22:38:33 +00:00
Owner

@⁠KelboLive on GitHub · 2026-11-23 23:59 UTC · original
KelboLive:hardware/rtx4070tisuper → main · +45 −3 · 2 files · 3 commits · merged 2026-11-24 00:51 UTC

Summary
Disassembler now matches LLVM 15 behavior: instructions after s_endpgm are decoded instead of being silently dropped. An after_endpgm boolean field marks which decoded instructions came after the terminator, so callers that still need to stop can use that signal.

Changes

  • tools/disasm_rdna2.py — removed break on s_endpgm; sets after_endpgm=false on all previous entries once the terminator is seen
  • tests/rdna2_tools_check.py — updated existing post-endpgm test; added test_decode_continues_past_s_endpgm

Tests
[*] Opening archive: collisions.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 4
Total Shaders Extracted: 4
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 4

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpk8059kee\extracted_collisions
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpk8059kee\extracted_collisions\manifest.json

[*] Opening archive: dups.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 2
Total Shaders Extracted: 2
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 2

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmp96nwj35c\extracted_dups
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmp96nwj35c\extracted_dups\manifest.json

[*] Opening archive: empty.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 0
Total Shaders Extracted: 0
Time Elapsed: 0.00 seconds

Extracted by Stage:

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpwvij50z1\extracted_empty
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpwvij50z1\extracted_empty\manifest.json

[*] Opening archive: synthetic_shaders.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 1
Total Shaders Extracted: 1
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 1

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpfm7afowf\extracted
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpfm7afowf\extracted\manifest.json

[*] Opening archive: source_built.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 7
Total Shaders Extracted: 7
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 7

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpl0r8rfxe\shaders
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpl0r8rfxe\shaders\manifest.json

[*] Opening archive: false_positive.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 1
Total Shaders Extracted: 1
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 1

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmp9opfkqt5\extracted_fp
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmp9opfkqt5\extracted_fp\manifest.json

[*] Opening archive: long.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 2
Total Shaders Extracted: 2
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 2

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmp1rs9rwns\extracted_long
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmp1rs9rwns\extracted_long\manifest.json

[*] Opening archive: oversized_span.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 2
Total Shaders Extracted: 2
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 2

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpzzqax22p\extracted_oversized
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpzzqax22p\extracted_oversized\manifest.json

[*] Opening archive: test.rpf (0.0 MB)...

============================================================
EXTRACTION COMPLETED

Total Shaders Found: 1
Total Shaders Extracted: 0
Time Elapsed: 0.00 seconds

Extracted by Stage:

  • pixel : 1

[+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmptqhsf5k0\extracted_compute
[+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmptqhsf5k0\extracted_compute\manifest.json

[] Scanned 1/1 files (1 valid shaders)...
[
] Scanned 2/2 files (2 valid shaders)...
[] Scanned 3/3 files (3 valid shaders)...
[
] Scanned 2/2 files (2 valid shaders)...
[*] Scanned 2/2 files (2 valid shaders)...
All 91 tests pass (5 skipped — LLVM-dependent checks).

Related
Refs #938
Refs #1055

**@⁠KelboLive** on GitHub · 2026-11-23 23:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1062) `KelboLive:hardware/rtx4070tisuper` → `main` · +45 −3 · 2 files · 3 commits · merged 2026-11-24 00:51 UTC **Summary** Disassembler now matches LLVM 15 behavior: instructions after s_endpgm are decoded instead of being silently dropped. An after_endpgm boolean field marks which decoded instructions came after the terminator, so callers that still need to stop can use that signal. **Changes** - tools/disasm_rdna2.py — removed break on s_endpgm; sets after_endpgm=false on all previous entries once the terminator is seen - tests/rdna2_tools_check.py — updated existing post-endpgm test; added test_decode_continues_past_s_endpgm **Tests** [*] Opening archive: collisions.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 4 Total Shaders Extracted: 4 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 4 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpk8059kee\extracted_collisions [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpk8059kee\extracted_collisions\manifest.json ============================================================ [*] Opening archive: dups.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 2 Total Shaders Extracted: 2 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 2 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmp96nwj35c\extracted_dups [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmp96nwj35c\extracted_dups\manifest.json ============================================================ [*] Opening archive: empty.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 0 Total Shaders Extracted: 0 Time Elapsed: 0.00 seconds Extracted by Stage: [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpwvij50z1\extracted_empty [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpwvij50z1\extracted_empty\manifest.json ============================================================ [*] Opening archive: synthetic_shaders.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 1 Total Shaders Extracted: 1 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 1 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpfm7afowf\extracted [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpfm7afowf\extracted\manifest.json ============================================================ [*] Opening archive: source_built.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 7 Total Shaders Extracted: 7 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 7 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpl0r8rfxe\shaders [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpl0r8rfxe\shaders\manifest.json ============================================================ [*] Opening archive: false_positive.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 1 Total Shaders Extracted: 1 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 1 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmp9opfkqt5\extracted_fp [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmp9opfkqt5\extracted_fp\manifest.json ============================================================ [*] Opening archive: long.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 2 Total Shaders Extracted: 2 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 2 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmp1rs9rwns\extracted_long [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmp1rs9rwns\extracted_long\manifest.json ============================================================ [*] Opening archive: oversized_span.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 2 Total Shaders Extracted: 2 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 2 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmpzzqax22p\extracted_oversized [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmpzzqax22p\extracted_oversized\manifest.json ============================================================ [*] Opening archive: test.rpf (0.0 MB)... ============================================================ EXTRACTION COMPLETED ============================================================ Total Shaders Found: 1 Total Shaders Extracted: 0 Time Elapsed: 0.00 seconds Extracted by Stage: * pixel : 1 [+] Shaders directory: C:\Users\Administrator\AppData\Local\Temp\tmptqhsf5k0\extracted_compute [+] Manifest file: C:\Users\Administrator\AppData\Local\Temp\tmptqhsf5k0\extracted_compute\manifest.json ============================================================ [*] Scanned 1/1 files (1 valid shaders)... [*] Scanned 2/2 files (2 valid shaders)... [*] Scanned 3/3 files (3 valid shaders)... [*] Scanned 2/2 files (2 valid shaders)... [*] Scanned 2/2 files (2 valid shaders)... All 91 tests pass (5 skipped — LLVM-dependent checks). **Related** Refs #938 Refs #1055
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:38:32 +00:00
github manually merged commit 73abcf11e5 into gh-pr/1062/base 2026-11-26 22:38:33 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 00:02 UTC · original

The decode-through-end behavior is under review in #1055, including LLVM 15 offsets and the unknown trailing word. The after_endpgm field is a distinct API addition. Please drop the unrelated MSVC preset, README and hardware-report changes from this PR. Once #1055 settles, a metadata-only diff can show the caller that needs the flag and cover records before, at and after the first terminator.

**@⁠R0Y00** on GitHub · 2026-11-24 00:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1062#issuecomment-7117637419) The decode-through-end behavior is under review in #1055, including LLVM 15 offsets and the unknown trailing word. The after_endpgm field is a distinct API addition. Please drop the unrelated MSVC preset, README and hardware-report changes from this PR. Once #1055 settles, a metadata-only diff can show the caller that needs the flag and cover records before, at and after the first terminator.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 00:25 UTC · original

Thanks for narrowing the branch to the decoder and its tests. The complete span was already decoded by #1055. The additive field now marks offsets strictly after the first endpgm, including when a second endpgm is present. A span with no terminator gets false for every row. The field reports byte order and does not establish reachability. I pushed 39b710ff and ran all 98 decoder and scanner tests with LLVM 15.

**@⁠R0Y00** on GitHub · 2026-11-24 00:25 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1062#issuecomment-7118061328) Thanks for narrowing the branch to the decoder and its tests. The complete span was already decoded by #1055. The additive field now marks offsets strictly after the first endpgm, including when a second endpgm is present. A span with no terminator gets false for every row. The field reports byte order and does not establish reachability. I pushed 39b710ff and ran all 98 decoder and scanner tests with LLVM 15.
This discussion has been locked. Commenting is limited to contributors.
No description provided.