startup: zero-extend R8_UINT vertex fetches #1238
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1245"
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 R0Y00 on 2026-11-24T05:07:01Z.
Refs #870. A startup pipeline refused
BUF_FMT_8_UINT. The translator now extracts the addressed byte from its containing dword and returns the missing integer components as(0, 0, 1).The source-built fixture fetches vertex-buffer slot 1 with stride 3 and offset 1. It checks the manifest, compiles the complete VS, calls its vertex body from a compute wrapper and compares all four raw component bits against the CPU byte reference for 16 independent indices. The other 256 output words must retain their sentinel. Switching the instruction encoding to R8_UNORM on the same input produces the expected mismatch at word 0.
Tested
e784374cwith the existing Releaseoffscreen_check.exeand Windows SDK 10.0.26100 DXC. From the checkout with those two tools on PATH:Windows 11 build 26200.9974. NVIDIA RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818 each matched 320/320 words, detected the UNORM control and reported zero debug-layer errors or warnings. The checks also register as
startup_r8_uint_warpandstartup_r8_uint_hardwarefor CTest.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:17:34Z.
Review: COMMENTED
Reviewed commit
e784374c(Linux host — Windowsoffscreen_checkbuild andstartup_r8_uint_{warp,hardware}GPU tests were not executed locally).Code & Edge-Case Audit
tools/startup/gfx2hlsl.py:BUF_FMT_8_UINTlowers tow = {0}.Load(a & ~3u) >> ((a & 3u) * 8u);with components['w & 255u', '0u', '0u', '1u'].ldu()(which also reads(a & ~3u) + 4whena & 3u != 0), this reads only the single aligned dworda & ~3u, avoiding an out-of-bounds+4read on tightly sized buffers.ByteAddressBuffer.Loadreturnsuint, so the right shift is unsigned andw & 255uzero-extends the selected byte to[0, 255]with no sign extension.0u,0u,1u(raw integer1, matching D3DR8_UINT(0, 0, 0, 1)rather thanU(1.0)).tests/startup_r8_uint_check.py,CMakeLists.txt,docs/experiments.md:AGENTS.mdcompliant).ud4) andoffset:1across 16 vertices (covering alla & 3ubyte lanes0..3), readingasuint(body(id).pos)from a compute wrapper to preserve exact integer bits, withR8_UNORM(format_code=1) as a negative control.tests/startup_r8_uint_check.pyonly has adrawentrypoint (no pure-Python mode wired into.github/workflows/windows.yml), thoughpipeline(5)/pipeline(1)work standalone in Python.Checks Run (Linux / Python / LLVM-19)
git diff --check origin/main...HEAD: pass (0 issues)/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: pass (16 Markdown files, 280 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: pass (1049 files)/root/.local/share/x2w-rev-venv/bin/python -B tests/form_coverage_check.py: passtests/startup_r8_uint_check.py(pipeline(5)andpipeline(1)): pass (verifiedr0.Load(a & ~3u) >> ((a & 3u) * 8u)andw & 255u,0u,0u,1u)/root/.local/share/x2w-rev-venv/bin/python -B tests/startup_sampler_heap_check.py: passLLVM_LIB=/usr/lib/llvm-19/lib/libLLVM-19.so /root/.local/share/x2w-rev-venv/bin/python -B tests/compute_store_check.py binary /usr/bin/llvm-mc-19 /usr/bin/llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: pass (exit 0)ctest -R '^startup_r8_uint_(warp|hardware)$': not run locally.