Replace the hardcoded operation chain in offscreen_check with a capability table #166
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#166
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@raulmoracode on GitHub · 2026-11-21 17:50 UTC · original
Problem
tests/offscreen_check.cppdispatches every GPU check through oneif/elsechain inmain(). Adding an operation currently means editing three separate places:main()(argc/operation pairing);needs_cs_6_5();The skip convention is also implicit.
check_bvh_differential,check_bvh_waves,check_ray_queryandcheck_dxr_updatereturnfalseonly for "unsupported", andmain()turns that intoreturn 77at four separate sites. A real mismatch is athrow. That works, but a new operation can easily return77for a genuine failure and be recorded as a capability skip in the README table.Proposed change
Replace the chain with a table of rows:
main()keeps the adapter and debug-layer setup, then selects a row and applies its capability gate. Exit codes become explicit:0pass,77only when the capability check fails,1for a thrown failure.A row cannot forget its own gate, and
ctest -Nnames keep coming from the same row.Alternatives
Verification path
No behaviour change is expected. Verification is that
ctest --preset dev -Nlists the same test names, every_warpand_hardwaretest returns the same result as before on WARP, and an added negative row returns1instead of77when its handler throws.This touches
tests/offscreen_check.cpp, which open pull requests #116, #118, #137 and #147 also edit, so it should land after those.AI-assisted.
@R0Y00 on GitHub · 2026-11-21 18:17 UTC · original
Lead design decision requested before implementation: should the operation table own capability gates and argument shapes, or should each handler own its capability check? #118 and #137 have landed. #116 and #147 still touch the runner. A candidate can preserve the CTest names and compare pass, capability skip (77) and failure (1) across both configurations.
@lambirou on GitHub · 2026-11-21 18:39 UTC · original
I'd like to take on #166. My preference is for the operation table to own each named command's argument shape and unconditional prerequisites, with scenario-dependent checks handled by the test itself.
check_wave_shuffle. It can run the native case and then decide which forced widths the adapter supports. A mismatch in any executed case remains a failure even when another width is unsupported.0for success,77for a capability skip,1for a test or D3D12 failure, and the existing usage-error paths.For verification, I'd compare the
ctest --preset dev -Nlists before and after, then compare exit codes on my RX 9060 XT and in-box WARP. The baseline from #145 gives a pass and a capability skip for the same operation. I'd also verify that a deterministic failed check still produces1.Does this split match what you want? If so, I can coordinate the patch with #116 and #147 so it preserves the adapter selection and app-local WARP paths.
AI-assisted proposal based on the current runner and the local #145 test run.
@raulmoracode on GitHub · 2026-11-21 18:42 UTC · original
This split matches what I would expect: the table owns the argument shape and the unconditional prerequisites, and a handler owns checks that depend on the scenario.
One addition matters for the original problem. The current convention is implicit: a handler returns
falsefor unsupported, throws for failure, and the runner turnsfalseinto77. That is how a real mismatch can be recorded as a capability skip. The table should make the outcome explicit — for example a small result type{pass, skip(reason), fail(detail)}, or aSkiptype distinct from a failure. Only the table, after evaluating the row's capability predicate, should be able to produce77; a handler should not be able to return it directly.Two points I would add to the verification plan:
SKIP_RETURN_CODEproperties as well as thectest -Nnames.1, and a row whose capability predicate is false and must exit77with a named reason. That pair is the control that the two paths cannot be confused again.On coordination: #116 and #147 change the runner's adapter selection and app-local WARP paths. Writing the table after they land, or against their final signature, avoids a third rebase.
AI-assisted.