shader: lower statically proven PC-relative branch targets #2230
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2238"
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 chadhyatt on 2026-11-25T07:03:59Z.
AI-assisted backport patch from x2w-microlift. Independently authored static proof for ordinary gfx1013 getpc/add/addc/setpc branches. Emits only proven in-program instruction-boundary targets with consistent incoming definitions; refuses ambiguous/clobbered/unsupported cases and preserves stage-scoped refusal census. External project progress served as a research lead, no external implementation copied. Source-built LLVM21 fixtures:
python3 -B tests/startup_gfx2hlsl_calculated_target_check.py binary /opt/homebrew/opt/llvm@21/bin/llvm-mc;python3 -B tests/startup_gfx2hlsl_interp_f16_check.py;python3 -B tests/startup_gfx2hlsl_refusals_check.py;python3 -B tests/docs_links_check.py: all passed on macOS ARM64, tested0784fda4on upstream71c9c347. Contributor glass24 independently reported actual WARP and RTX 4070 Ti source-built draw evidence on the private adaptation (all channels 8, changed-displacement control 14); not rerun here. No retail or broad shader coverage claim.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T07:05:23Z.
Review: COMMENTED
Review of head
0784fda434a2e0c0015c5db6971acd5760ae7362(Linux only, no Windows run).Commands executed locally
git diff --stat origin/main...HEAD: 7 files, +507/-3. Title neutral, MIT, no external code claimed.python3 -B tests/startup_gfx2hlsl_calculated_target_check.py binary /usr/lib/llvm-19/bin/llvm-mc: pass (ambiguous, clobber, literal-target and outside-program cases all refuse).python3 -B tests/startup_gfx2hlsl_interp_f16_check.py: passpython3 -B tests/startup_gfx2hlsl_refusals_check.py: passpython3 -B tests/docs_links_check.py: pass (419 links)python3 -B tests/bidi_controls_check.py: passgit diff --check origin/main...HEAD: cleanMutation testing
calculated_pc_proof, replacedif imm != fact[1]:(high-word must be the sign extension of the low-word displacement) withif False:. The calculated-target test still passed. SURVIVED.if not 0 <= target < end:withif False:. The test still passed, but the case is still refused by the next interior-of-instruction check, so only the message changes. Equivalent mutant, not a gap.Findings
tools/startup/gfx2hlsl.py(imm != fact[1]check in thes_addc_u32branch ofcalculated_pc_proof) has no killing test. The only ADDC fixture iss_addc_u32 s21, s21, 0(tests/startup_gfx2hlsl_calculated_target_check.py:33), which only covers a non-negative displacement. Please add a negative-displacement positive case (high word-1) and a mismatched-high-word refusal case (for example a negative low displacement withaddc ..., 0, and a positive one withaddc ..., -1). The check guards a wrong-address silent miscompile.check_encodingraises's_setpc_b64: unsupported %s encoding'even when the name iss_getpc_b64. The message prefix is misleading.gfx2hlsl.py, so a Win2025 WARP readback vs CPU reference is still owed before merge. I did not run it.No P1 found.
AI-assisted; commands listed were executed locally.