startup: record a bounded per-draw texel history (Part of #1268) #2820
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2828"
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 lambirou on 2026-11-26T12:18:17Z.
X2W_DRAW_DUMP_FRAMEcopies the whole target after each translated draw, up to 48 times, so a blackframe shows that a pixel is black but not which draw last wrote it. This adds a bounded per-texel
history for the same frame.
X2W_DRAW_DUMP_PIXEL=<x>,<y>(withX2W_DRAW_DUMP_FRAME) makes each recorded copy cover onetexel of render target 0. The present writes
pixel_history.txtinX2W_DRAW_DUMP_DIR, one line pertranslated draw:
drawis the copy ordinal,frameis the frame that recorded it,keyis the translated manifest key, andrgbais decodedfor R8G8B8A8/B8G8R8A8 UNORM or sRGB. The 48-copy bound is unchanged. Other formats keep the full
dump behaviour.
startup_pixel_historyis a source-built 4x4 target with three draws. The first and third arescissored to the top-left texel; only the second covers the watched texel (1, 1). The report must
name draw 2 with its key and green value, and the control that omits draw 2 must leave the texel
black at draw 3.
d3d12_xs_shimbuilds in the dev preset;docs_links_check.py(27 files, 541 links) andbidi_controls_check.py(2,036 files) pass, as doesgit diff --check.This is part of #1268. The format is limited to the 8-bit four-channel targets the full dump already
supports; the runtime copy is exercised by the same
CopyTextureRegionpath as the full dump.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T13:17:51Z.
Review: COMMENTED
Review of head
62e332b8against main (comment review, no approval).Checked:
draw_dump_afterreturns whendraw_dumps().full(), andrecordrefuses atentries_ + consumed_ >= 48. The static sample list indraw_dump_flushcan only grow by completed copies, so it is capped at 48 too.draw_dump_afterreturns first unlessX2W_DRAW_DUMP_FRAMEis set.X2W_DRAW_DUMP_PIXELis only read for that frame and must parse exactly as<x>,<y>. Without the pixel variable the old full-target dump path is unchanged.CopyTextureRegion.Finding (not a blocker, worth a follow-up):
tests/startup_pixel_history.cppincludes onlypixel_history.hand does its own copy in the test. It never runsdraw_dump_after/draw_dump_flushind3d12_draw.inl. So a break in the runtime part (ignoring the box, the env parsing, skipping the 48 limit) would not turn the test red. The negative control only omits draw 2 from the list, so it guards the report format and decode, not the runtime hook. A small check that drives the real translated draw path with the env set would close this.Commands run (Linux):
git diff --check origin/main...HEAD,python3 tests/docs_links_check.py(27 files, 541 links),python3 tests/bidi_controls_check.py(2038 files): all pass.Win2025 WARP, same head: dev 5/5 and release 5/5 for
startup_pixel_history_warp|startup_dump_fence|startup_teardown(includes the new test). Real-GPU run not available (RunPod stopped).Merge stays open until CI on this head is green.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T13:17:55Z.
Win2025 WARP receipt for head
62e332b8.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
62e332b862aec1b71290aa1087664c907b757d46:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_dump_fence_check startup_pixel_history -- -j 2):29.80s(configure1.51s)ctest --preset dev -R 'startup_pixel_history_warp|startup_dump_fence|startup_teardown' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.42s:startup_pixel_history_warp0.07s,startup_dump_fence_removed_control_warp0.08s,startup_dump_fence_warp0.09s,startup_teardown_unload_hardware0.26s,startup_teardown_unload_warp0.28s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_dump_fence_check startup_pixel_history -- -j 2):36.58s(configure1.56s)ctest --preset release -R 'startup_pixel_history_warp|startup_dump_fence|startup_teardown' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.45s:startup_dump_fence_warp0.07s,startup_dump_fence_removed_control_warp0.06s,startup_pixel_history_warp0.07s,startup_teardown_unload_warp0.27s,startup_teardown_unload_hardware0.29s)sccache: 10/28 hits; wall76.6sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-26T13:20:26Z.
Thanks for the review. The runtime-hook gap is tracked in #2843: a fixture that presents a guest target, draws through the translated path with X2W_DRAW_DUMP_FRAME=1 and X2W_DRAW_DUMP_PIXEL set, then presents again to flush pixel_history.txt. This landed PR stays as the report/decode slice.