tooling: report the first scene-colour write from draw dumps #3177
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3177
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3175"
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?
@lambirou on GitHub · 2026-11-27 20:24 UTC · original
lambirou:codex/scene-color-trace→main· +1222 −1 · 5 files · 2 commits · merged 2026-11-27 21:44 UTCChanges
Adds
tools/startup/scene_color_report.py, an offline reader for the existingpixel_history.txtand full-frame BMP diagnostics. For a selected frame and pixel it names the first retained colour change as well as the last writer, and classifies the history as no draw, UI only, target write, unchanged, truncated or non-RGBA8.The report is bounded and never echoes input paths, raw log lines or arbitrary text. It does not change the runtime, the shaders or the dump format.
Validation
The synthetic check covers first change and last writer, a write restoring the baseline, no change, empty history, malformed lines, a non-RGBA8 target, BGRA order, the 48-sample cap, frame and pixel selection, a supplied baseline, BMP match and mismatch, a header/record mismatch and a missing history file.
Limits
This is a reader for diagnostics that already exist; it does not run the title and does not prove that a draw is a scene draw. No local dump was available under
out/for this change, so the checked results are synthetic. The next step is to run the title withX2W_DRAW_DUMP_FRAMEandX2W_DRAW_DUMP_PIXELon a fixed profile and input sequence.Refs #870.
@pigalot on GitHub · 2026-11-27 21:43 UTC · original · approved these changes
Independently reviewed
aff14cbeintegrated overmainafe70bd7(treeb3b54873). The merge is clean.What I traced. I compared the tool's parser and decoders with the runtime code it reads:
HEADER_REandSAMPLE_REmatch whatpixel_history_write(src/startup_stubs/pixel_history.h) prints:draw=%llu frame=%ld x=%u y=%u key=%016llx count=%u format=%d raw=%08x, plus an optionalrgba=.decode_rgbauses the same byte order aspixel_history_decodefor DXGI 28/29 (RGBA) and 87/91 (BGRA).RUNTIME_SAMPLE_LIMIT = 48isDrawReadbacks::limit. That limit counts copies taken plus copies in flight, for the whole process (draw_dump_tracking.h). A history of exactly 48 samples is therefore reported ashistory_truncatedeven if nothing was dropped. That is the conservative reading.draw_%02d_%016llx_%u.bmp.x2w_draw_bmp::writewrites 32-bit, bottom-up, B,G,R,255 rows, which is what_bmp_pixelreads back.What I ran.
startup_pixel_history_warpprints frompixel_history_writeon adevbuild of the trial merge and wrote them under the runtime header. Then I ranpython -B tools/startup/scene_color_report.py <dir> --pixel 1,1. It reportstarget_write, with first change and last writer bothdraw=2,key=2222222222222222,raw=0xff00ff00,0,255,0,255. That matches the fixture's expectation: only draw 2 covers texel (1, 1).main.Mutants (each applied alone to
tools/startup/scene_color_report.py, check rerun, file restored from its raw bytes,git diff --quietclean afterwards):decode_rgbatest_bgra_format_uses_the_documented_channel_order)test_history_cap_marks_truncated_and_bounds_rows)!=baseline →==test_bmp_cross_check_and_mismatch_control)test_header_mismatch_is_bounded)--baseline-rawignoredtest_supplied_baseline_can_name_the_first_draw)_bmp_pixel--framefilter droppedfind_baseline) disabledNon-blocking notes.
(0, 255, 0), so a red/blue swap reads the same. A colour with R ≠ B would pin it.test_frame_and_pixel_selection,--pixel 0,0alone already picks frame 1, so--frameis never what decides. Two frames at the same pixel would pin it.find_baselinepath is unexercised.git diff --check origin/main review/3175reportsdocs/experiments/startup-scene-color-report.md:113: new blank line at EOF.The PR body listsgit diff --checkas run.aucun draw,draw UI seulement, …) in both the report output and the doc table, while the rest of the repository is English. The tagui_onlysays more than the tool can know: it means "no retained sample changed this pixel". Your doc already says so, but a neutral tag such asno_changewould carry that into the report itself.Verdict: approve on
aff14cbe.Environment: Microsoft Basic Render Driver (WARP) for
startup_pixel_history_warp, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, debug layer off.CI:
Build and test on Windows,Assemble and translate gfx1013 fixturesandRun platform-independent Python checks on Linuxpass onaff14cbe.This reply was AI-assisted.
@lambirou on GitHub · 2026-11-27 22:24 UTC · original
@R0Y00 @pigalot #3177 has no review yet. It is the scene-colour report tool from the 27/11 batch, head
aff14cbe, with its synthetic check and CI green; could you take a look?