Replace the hardcoded operation chain in offscreen_check with a capability table

Open
#166 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@lambirou is already working on this.

Since Nov 21, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, cpp
Domain
testing-qa

Research direction

Start in tests/offscreen_check.cpp: read the argument validation at the top of main(), the needs_cs_6_5() capability list, and the if/else dispatch chain, plus the four check_* functions that return false for unsupported. Wait for open PRs #116, #118, #137 and #147 to land first, since they edit the same file. Done means ctest --preset dev -N lists the same names, WARP and hardware tests give the same results, and a test row that throws exits with 1, not 77.

Written by the indexing model from the issue text.

Description

Problem

tests/offscreen_check.cpp dispatches every GPU check through one if/else chain in main(). Adding an operation currently means editing three separate places:

  • the argument validation block near the top of main() (argc/operation pairing);
  • the capability list in needs_cs_6_5();
  • the dispatch chain itself.

The skip convention is also implicit. check_bvh_differential, check_bvh_waves, check_ray_query and check_dxr_update return false only for "unsupported", and main() turns that into return 77 at four separate sites. A real mismatch is a throw. That works, but a new operation can easily return 77 for a genuine failure and be recorded as a capability skip in the README table.

Proposed change

Replace the chain with a table of rows:

{name, minimum shader model, DXR tier required, argument shape, handler}

main() keeps the adapter and debug-layer setup, then selects a row and applies its capability gate. Exit codes become explicit:

  • 0 pass,
  • 77 only when the capability check fails,
  • 1 for a thrown failure.

A row cannot forget its own gate, and ctest -N names keep coming from the same row.

Alternatives

  • Keep the chain and add a comment listing every capability assumption. Cheaper, but does not prevent the next operation from being added without a gate.
  • Move capability checks into each check function and keep the chain. This is closer to the current code but leaves three edit points.

Verification path

No behaviour change is expected. Verification is that ctest --preset dev -N lists the same test names, every _warp and _hardware test returns the same result as before on WARP, and an added negative row returns 1 instead of 77 when 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.

Dominant language
Python
Stars
696
Forks
61
Avg merge
25m
Merged PRs (30d)
171

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from R0Y00/Xbox2Windows

All issues in R0Y00/Xbox2Windows

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.