Add binary shader scanning and stage progress dashboard to RDNA 2 scanner #238
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/241"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-21T18:59:42Z.
Summary
Enhances
tools/scan_unsupported_shaders.pywith standalone binary shader intake and visual stage progress reporting:.bindisassembly support using nativedisasm_rdna2without requiring an externallibLLVMdependency.pixel,compute,vertex,other) based on directory structure and symbol naming (detect_shader_stage).PROGRESS.mdandprogress.json) featuring ASCII coverage bars, ISA subsystem breakdowns, and high-impact missing opcode blocker rankings (Shaders Blocked,Blocker Impact %).tests/rdna2_tools_check.py.Evidence
Ran automated RDNA 2 tooling test suite on Windows:
Observed output:
Also verified pure-Python checks across repository:
Observed output: all 6 test suites passed (0 errors, 0 failures).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T19:14:44Z.
The current head conflicts in
tools/scan_unsupported_shaders.pyafter #231. Please preserve the VOPC classification, inline//handling and instruction-only denominator alongside the binary intake changes, then rerunpython -B tests/rdna2_tools_check.py.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-21T19:23:53Z.
@R0Y00 Rebased onto current
upstream/main(1485f17) and resolved conflicts cleanly intools/scan_unsupported_shaders.py:v_cmp*categorized as"VOPC (Vector Compare)"before any_f16/_f32VALU check).//handling (re.split(r"//|[;#]", line)[0].strip()) across opcode extraction, comment stripping, and pattern matching.totalcounter increments strictly for non-empty instruction lines excluding blank lines and comments).disasm_rdna2and visual pipeline stage breakdown dashboard.Verified test suite:
Output:
Also ran all pure-Python check fixtures:
tests/bcpack_check.py(8 tests OK)tests/dxcontainer_part_offsets_check.py(7 tests OK)tests/layout_chunks_check.py(summary OK)tests/resource_ranges_check.py(5 tests OK)tests/script_state_check.py(13 tests OK)tests/intake/paths_check.py(OK)Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T19:57:38Z.
disassemble_binary_shadercatches every exception and returns[], and the.bincaller only appends a result when that list is nonempty. A decoder failure therefore drops the input from the dashboard denominator and can make the remaining files look fully covered. Please retain a failed-input record (or fail the scan with the path and diagnostic), and add a mixed good/bad binary test that accounts for both inputs.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-21T20:16:16Z.
@R0Y00
Updated in
04030eb:disassemble_binary_shadernow propagates decoder errors / raisesValueErroron empty or undecodable data rather than silently swallowing exceptions into[].scan_directory_or_filescaptures decoder/IO failures and retains a failed-input analysis record (make_failed_shader_record) containing the file path and specific diagnostic inlower_error. This prevents decoder failures from being dropped from the scan denominator.generate_progress_dashboardand report generators now account for zero-instruction / failed decode records in the completely unsupported count and denominator calculation.test_disassemble_binary_shader_errorverifyingdisassemble_binary_shaderraises on invalid input.test_mixed_binary_shader_scanningintests/rdna2_tools_check.pyscanning a directory containing both valid and corrupt/empty.bininputs, asserting:len(results) == 2and in the dashboard'stotal_shaders.lower_status == "decode_failed"with the diagnostic.Test suite run:
Output:
Also re-verified pure-Python checks across repository:
tests/form_coverage_check.py(passed)tests/bcpack_check.py(8 tests OK)tests/dxcontainer_part_offsets_check.py(7 tests OK)tests/layout_chunks_check.py(summary OK)tests/resource_ranges_check.py(5 tests OK)tests/script_state_check.py(13 tests OK)tests/intake/paths_check.py(OK)Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T20:25:57Z.
The failed binary now has its own record. The stacked #271 exposed a remaining test issue:
coverage_percentagedivides supported instructions by decoded instructions, and the empty input contributes zero instructions. Once all instructions inps_good.binare recognized, the percentage legitimately reaches 100 andassertLess(..., 100.0)fails. Please keep the instruction metric clearly labeled and test the file-level denominator separately (two inputs, one decode failure). Include a case where every decoded instruction is supported. Windows failure on the stacked PRImported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-21T20:55:30Z.
@R0Y00 Updated in
57a07b0:- Clearly labeled the instruction metric as
Instruction Coverage/Total Decoded Instructions(
instruction_coverage_percentage) acrossPROGRESS.md,progress.json, and terminal summaries.- Separated the file-level denominator assertion from instruction coverage in
test_mixed_binary_shader_scanning: includes a case where all decoded instructions are supported(
instruction_coverage_percentage == 100.0), while verifying the file-level denominator retains the decodefailure (
total_shaders == 2,completely_unsupported == 1, 50% file-level blocked).- Verified with
python -B tests/rdna2_tools_check.py(26/26 passed) and full CI passes across all platforms