Scripts: analyze verified compute dumps with AMD RGA #2871

Open
IISKII1 wants to merge 6 commits from upstream-pr/2871 into main
IISKII1 commented 2026-11-26 20:05:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by IISKII1 on 2026-11-26T20:05:54Z.


Stacked on #2870 (which follows #2553); only the top commit belongs here. Part of #2562.

Add opt-in AMD RGA offline compute analysis to the verified bundle command. Preserve raw logs, argv, tool version, exit code, wall time and CSV statistics. Missing tools/unsupported stages skip; failed or timed-out analysis is an error. A zero exit without nonempty ISA is not success.

What is in it

  • scripts/shader_rga.py, CLI options, eight tests and README usage. Explicit offline target; no runtime changes or automatic downloads.

Tested

  • Windows 10 Pro build 19045, Radeon RX 7700 XT driver 32.0.22021.1009, Rust 1.94.0 MSVC, Python 3.13, DXC 1.8.2502.11; debug.
  • python -B -m unittest discover -s scripts -p test_*.py: 43 passed, 0 failed, including real subprocess exit/log and timeout tests. The other analyzer tests use synthetic responses.
  • Real RGA 2.15.0.30 with a minimal DXC-built cs_6_0 demonstration shader, embedded root signature, target gfx1101: analysis_complete; ISA and CSV generated, ISA_SIZE 268, USED_VGPRs 3, USED_SGPRs 17. This fixture is not an XCL translation or game shader, and these are offline compiler statistics, not GPU measurements.
  • Invocation: python -B scripts/analyze_shader.py sample.manifest.json --out reports --rga <official-rga.exe> --target gfx1101 --timeout 60.
  • scripts/test.ps1 built successfully but stopped at library tests: 1297 passed, 3 failed, 26 ignored, 345 explicit GPU skips included in passes. Failures: passthrough_mesh_stream_accepts_a_triangle_driver_blob, split_compute_program_prebuilds_and_caches_chain_pieces, stale_blob_cannot_bypass_the_offline_pipeline_cap (no SM 6.6). Integration tests did not run. Rust sources unchanged from the dependency.
  • git diff --check passed.

Not tested

  • Real XCL-produced DXIL through RGA, retail title, graphics stages, NVIDIA, host-adapter discovery, unsupported offline targets and other RGA releases. No GPU execution coverage for skipped tests. Occupancy is not inferred. Draft pending dependencies, a translated-shader check and full Windows validation.

AI use

  • Codex (GPT-6) implemented and reviewed the code, ran tests and the official AMD tool, and drafted the description.
<!-- greyfinch-sync:ivall/xcl:issue:5516468312 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2871). Originally posted by [IISKII1](https://github.com/IISKII1) on 2026-11-26T20:05:54Z. --- Stacked on #2870 (which follows #2553); only the top commit belongs here. Part of #2562. Add opt-in AMD RGA offline compute analysis to the verified bundle command. Preserve raw logs, argv, tool version, exit code, wall time and CSV statistics. Missing tools/unsupported stages skip; failed or timed-out analysis is an error. A zero exit without nonempty ISA is not success. **What is in it** - scripts/shader_rga.py, CLI options, eight tests and README usage. Explicit offline target; no runtime changes or automatic downloads. **Tested** - Windows 10 Pro build 19045, Radeon RX 7700 XT driver 32.0.22021.1009, Rust 1.94.0 MSVC, Python 3.13, DXC 1.8.2502.11; debug. - python -B -m unittest discover -s scripts -p test_*.py: 43 passed, 0 failed, including real subprocess exit/log and timeout tests. The other analyzer tests use synthetic responses. - Real RGA 2.15.0.30 with a minimal DXC-built cs_6_0 demonstration shader, embedded root signature, target gfx1101: analysis_complete; ISA and CSV generated, ISA_SIZE 268, USED_VGPRs 3, USED_SGPRs 17. This fixture is not an XCL translation or game shader, and these are offline compiler statistics, not GPU measurements. - Invocation: python -B scripts/analyze_shader.py sample.manifest.json --out reports --rga <official-rga.exe> --target gfx1101 --timeout 60. - scripts/test.ps1 built successfully but stopped at library tests: 1297 passed, 3 failed, 26 ignored, 345 explicit GPU skips included in passes. Failures: passthrough_mesh_stream_accepts_a_triangle_driver_blob, split_compute_program_prebuilds_and_caches_chain_pieces, stale_blob_cannot_bypass_the_offline_pipeline_cap (no SM 6.6). Integration tests did not run. Rust sources unchanged from the dependency. - git diff --check passed. **Not tested** - Real XCL-produced DXIL through RGA, retail title, graphics stages, NVIDIA, host-adapter discovery, unsupported offline targets and other RGA releases. No GPU execution coverage for skipped tests. Occupancy is not inferred. Draft pending dependencies, a translated-shader check and full Windows validation. **AI use** - Codex (GPT-6) implemented and reviewed the code, ran tests and the official AMD tool, and drafted the description.
Foniass commented 2026-12-01 09:05:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:05:56Z.


Triage (#1607) – head 57a8078

Stacked on #2870, which is stacked on #2553. Only 57a80785 (scripts/shader_rga.py, the --rga/--target/--timeout options, tests, README) belongs to this PR. The overlap with #2870 and #2553 is their own commits, not a duplicate.
No problems found in the top commit: the stage check matches coverage::stage_name ('CS', 'kernel'), a non-.exe tool is refused on Windows, a timeout kills the process tree, and a zero exit without ISA output counts as a failure.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7306211688 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2871#issuecomment-7306211688). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:05:56Z. --- **Triage (#1607)** – head 57a8078 Stacked on #2870, which is stacked on #2553. Only 57a80785 (scripts/shader_rga.py, the --rga/--target/--timeout options, tests, README) belongs to this PR. The overlap with #2870 and #2553 is their own commits, not a duplicate. No problems found in the top commit: the stage check matches coverage::stage_name ('CS', 'kernel'), a non-.exe tool is refused on Windows, a timeout kills the process tree, and a zero exit without ISA output counts as a failure. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2871:upstream-pr/2871'
git switch 'upstream-pr/2871'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2871'
git switch 'upstream-pr/2871'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2871'
git switch 'upstream-pr/2871'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2871'
git switch 'main'
git merge --squash 'upstream-pr/2871'
git switch 'main'
git merge --ff-only 'upstream-pr/2871'
git switch 'main'
git merge 'upstream-pr/2871'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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
xcl-dev/xcl!2871
No description provided.