startup: check that the last derived blend patch wins #1447
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!1447
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1447/head"
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?
@Asimmimx on GitHub · 2026-11-24 11:44 UTC · original
Asimmimx:startup/derived-blend-check→main· +117 −0 · 3 files · 1 commits · merged 2026-11-24 11:57 UTCChange
Refs #1149. That issue asks for a specific untested stand-in behavior and a source-built control for it. This PR covers the slot-55 blend-patch scan in
src/startup_stubs/derived_blend.h(x2w_derived_blend::last_blend).Before this PR, the only CTest that reached the header was
startup_stream_draw_{warp,hardware}, through the slot-55 derivation intests/startup_stream_consumer.cpp. That draw catches the faults that change rendering. It cannot observe:blend from ... at +0xlog line;The device never passes anything other than
count * record_sizebytes, and it rejects a null list when count > 0.This PR adds
startup_derived_blend, a device-free C++ check with 11 cases:0x102,0x2000000,~0);D3D12_BLEND_DESCagainst a counting pattern;startup_derived_blend_first_wins_controlruns the same check with--mutate first-winsand must fail (WILL_FAIL).The change is test, CMake and
docs/startup-runtime.mdonly. The header andd3d12_xs_device.cppare unchanged.Verification
Commit
92bd3362(main) plus this change,devpreset (Debug), Windows 11 Pro build 26300.9974, MSVC 19.51.36260, Windows SDK 10.0.26100.0.tests/docs_links_check.py(16 files, 324 links),tests/bidi_controls_check.pyandgit diff --checkall passed. The new test is CPU-only: no device, Python or FXC.Mutation probe
I applied each mutation to
derived_blend.halone, rebuilt, ran both tests, then reverted. None of this is committed.startup_stream_draw_warpstartup_derived_blendbytes % record_sizecheckoffset = at), copy unchangedWith the size check or the null check dropped, the scan reads out of bounds, so the new test ends in an access violation rather than a clean failure. It prints the failing case name before that.
Checklist
AI-assisted (Claude Code).
x2w_derived_blend::last_blend was reached only through the slot 55 draw in startup_stream_draw_{warp,hardware}. That draw kills a forward scan, a wrong or missing tag match and an off-by-one at either end, but it cannot see the descriptor offset the scan reports (only logged), and the device never hands it a null list or one that is not whole records. Mutants that report the tag's offset instead of the descriptor's, drop the whole-record check or drop the null check all pass that test. startup_derived_blend checks the header without a device: one and two blend patches, a blend patch before, between and after other parts, tags that only resemble 2, the returned offset and a byte-for-byte copy of the descriptor, and empty, null, short and prefixed lists. The first-wins control expects the earlier patch and must fail.