tooling: the shader scan reports an unbound entry register as a translator rejection (bare KeyError) #1307
Closed
opened 2026-11-24 07:41:12 +00:00 by MasterDomino
·
3 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
R0Y00/Xbox2Windows#1307
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 MasterDomino on 2026-11-24T07:41:12Z.
tools/scan_unsupported_shaders.pyreports a record as "opcodes recognized, translator rejected" wheneverpixel_aot.lower()raises. On one local input, 10,861 of 12,101 records reach that verdict through a bareKeyError. The cause is an entry register that the scanner never binds, not an instruction the translator refuses. The recorded reason is just the register name,'s9'. The scan therefore cannot show what actually blocks the translator.Setup
upstream/mainatf9710f64, Windows 11 (build 26300), Python 3.13.1, LLVM 15.0.7LLVM-C.dll.tools/extract_shaders.py --stage pixel --format native. Aggregates only.python -B tools/scan_unsupported_shaders.py --llvm <LLVM-C.dll> --output-dir <out> <records>What the scanner does
analyze_shader_instructionscallslower()with the same arguments for every record:texture_sgpr=20,interp_sgpr=24,sampler=[1, 2, 3, 4]and no constant bindings. It storesstr(e)for any exception.lower()reads an unbound register with a plainscalar[src]/vector[src]lookup, so the stored reason is the bare key.Measured (
lower_errorinshader_scan_report.json)KeyErroron an SGPR ('s9'10,112,'s11'263,'s17'159,'s12'98,'s15'70, others 46)KeyErroron a VGPR ('v3'108, others 5)32-bit execution mask save requires a validated wave32 guest profileUnexpected sample count or missing color exportUnresolved constant buffer bindingValueError(writelane,comprexport, ds_swizzle, unbound pixel input at a conversion, …)Here is where the unbound register is first read, using LLVM 15 disassembly of the same records with the scanner's arguments. Of the 10,785 records that raise a bare
KeyErrorthere:s_mov_b32 sN, sN(a copy of an entry SGPR): 10,334s_mov_b32 m0, sN: 323v_mov_b32_e32 vN, vN: 107The scanner and LLVM counts differ slightly because the scanner disassembles with
disasm_rdna2.Experiment, not a proposal. As a local hypothesis check, I patched
TrackedScalar.__getitem__to return an opaque value for any unbound SGPR. With that patch, the first rejections are:Unresolved constant buffer bindingUnbound pixel input vNatv_cvt_u32_f32_e32Unbound texture descriptor offsetKeyErroron a VGPRSo even past the entry copy, almost every record stops on a missing binding contract rather than on an instruction. Without per-record bindings, the scan's translator column mostly measures the harness.
Proposed change (one small PR)
pixel_aot.lower(): report an unbound entry register as aValueErrorthat names the register and the instruction, e.g.Unbound scalar input s9 at instruction N: <instruction>. This matches the existingUnbound pixel input vN at …messages. One way is a single translation ofKeyErrorat the per-instruction dispatch, which covers every handler without touching them one by one. The CLI already catchesKeyErrorand would print the clearer message. Two checks intests/pixel_aot_check.pycurrently assert the bare key (('v20',)for thev_mac_legacyaccumulator and('s9',)for an unbound table register). They would assert the new message instead. Both still require a refusal, and the new assertions are stricter.scan_unsupported_shaders.py: keep the per-recordlower_error, but add a summary field that separatesunbound entry register(no binding contract supplied) from real translator rejections. The Markdown report would then state that the translator column only covers records whose bindings the scan supplies. No change to the opcode coverage columns.Out of scope here: inferring each record's real binding contract (descriptor tables, interpolation base, constant buffers). That needs data the extractor does not carry yet. If you prefer, part 2 could wait until such a contract exists, and part 1 could go alone.
@R0Y00, is this worth doing, and should both parts go in one PR or two? I can take it once you confirm.
Limits
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T07:57:12Z.
Please take this as one focused diagnostics PR. Give missing scalar and vector operand reads a structured diagnostic with the register and instruction (and the byte offset when available), then have the scanner count that diagnostic separately while retaining the per-record reason. Keep unexpected lookup errors distinguishable so an internal bug does not get reported as a missing binding. A small source-built check should distinguish an unbound SGPR, an unbound VGPR, an unsupported opcode, and a bound sample that still translates. Keep the opcode column as-is and describe the acceptance totals as conditional on the bindings supplied by the scan.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T08:02:22Z.
Claiming this as one diagnostics PR: a structured missing-operand diagnostic for scalar and vector reads (register, instruction, byte offset when available), unexpected lookup errors kept distinguishable, the scanner counting it separately with the per-record reason kept, a source-built check (unbound SGPR, unbound VGPR, unsupported opcode, bound sample that translates), opcode column unchanged and acceptance totals described as conditional on the scan's bindings. I'll link the PR here.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T08:28:57Z.
PR: https://github.com/R0Y00/Xbox2Windows/pull/1337.
UnboundOperand(aValueError) names the bank, register, instruction and byte offset; other missing keys stayKeyErrorand the scan counts them as unexpected errors. On the local input every verdict is unchanged; the 10,861 bare-key rejections now split into 10,748 unbound scalar and 113 unbound vector operands, leaving 1,240 real rejections.AI-assisted.