gpu: make DXR opacity TMin configurable #1855

Merged
FAJIFBEFJHA merged 2 commits from upstream-pr/1862 into main 2026-11-24 20:19:42 +00:00
FAJIFBEFJHA commented 2026-11-24 19:44:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by FAJIFBEFJHA on 2026-11-24T19:44:20Z.


Change

Refs #1011

Add an optional --tmin <value> to the --dxr-opacity and --dxr-opacity-pipeline operations of offscreen_check so one build can sweep TMin on inline RayQuery and DispatchRays. Both operations print the effective value as dxr_opacity_tmin.

The CLI accepts finite values in [0, 0.5] and rejects invalid arguments with exit code 2 before D3D12 setup. The fixture's intersections lie at distances 1 through 4 in either direction, with TMax=8, so the independent reference table applies throughout the supported range. The default remains 0.25. The four CTest invocations and the strict origin-relative distance checks keep their existing behavior.

Verification

Tested 90d39cadb27c91d5d2096654f1a02117db615736 based on 813045b3c13f7bad20d8577557b621ee869ccbba.

  • Windows 11 Pro 26H2 x64 build 26300.9974, MSVC 19.52.37029.0, Windows SDK 10.0.26100.0, DXC 1.8.2502.11, CMake/CTest 4.3.1-msvc1 and Python 3.13.5.
  • AMD Radeon RX 7600 (1002:7480, driver 32.0.32029.2010) and in-box WARP (1414:008c, driver 10.0.26100.9818). Both reported DXR Tier 1.1 and SM 6.5 in the fixture query. The D3D12 debug layer was enabled and reported zero errors and warnings on every DXR run.
.\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev --target offscreen_check --parallel 6
cmake --preset release
cmake --build --preset release --target offscreen_check --parallel 4
.\out\build\release\offscreen_check.exe --self-test
$env:XBOX2WINDOWS_ADAPTER = 'RX 7600'
ctest --preset dev --no-tests=error -j 1 -R '^(offscreen_capability_table_self_test|dxr_opacity_(pipeline_)?(hardware|warp))$' -V
.\out\build\dev\offscreen_check.exe hardware --dxr-opacity --tmin nan
$LASTEXITCODE
.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py
git diff --check origin/main...HEAD

Both builds and both CLI self-tests passed. CTest reported 3 DXR PASS, 1 known DXR FAIL and 0 SKIP. dxr_opacity_hardware reproduced the 41 committed-distance mismatches at the default TMin, so CTest exited 8. The DispatchRays hardware test and both WARP tests passed. All four matched their explicit --tmin 0.25 counterparts. All 29 invalid invocations returned 2 before D3D12 setup, including the NaN example above. The documentation link check and git diff --check passed.

Run the sweep from the same checkout with the Debug executable:

$exe = '.\out\build\dev\offscreen_check.exe'
foreach ($repeat in 1..3) {
    foreach ($adapter in 'hardware', 'warp') {
        foreach ($operation in '--dxr-opacity', '--dxr-opacity-pipeline') {
            foreach ($tmin in '0', '0.25', '0.5') {
                & $exe $adapter $operation --tmin $tmin
                "$repeat $adapter $operation TMin=$tmin exit=$LASTEXITCODE"
            }
        }
    }
}
Adapter and path TMin 0 TMin 0.25 TMin 0.5
RX 7600 inline RayQuery PASS · 0 FAIL · 41 FAIL · 41
RX 7600 DispatchRays PASS · 0 PASS · 0 PASS · 0
WARP inline RayQuery PASS · 0 PASS · 0 PASS · 0
WARP DispatchRays PASS · 0 PASS · 0 PASS · 0

Each cell gives the status and mismatch count per run. The three serial repetitions agreed (30 PASS, 6 FAIL, 0 SKIP). The CPU reference reported 126 rays, 94 hits, 42 shader commits, 32 misses and 36 first-hit rays on every run. WARP inline recorded the existing 11 warp_after_commit cases per run.

I also repeated the Debug and Release builds, both CLI self-tests, the registered DXR tests, all 36 sweep runs, the 29 invalid invocations and the link check after a local test merge into upstream fb8947f0. The upstream change touched a startup wrapper linked by offscreen_check. The test merge produced tree df8578950f9761d41b35a84222ce058e31abcd83 and matched the results above.

$merge = 'out/x2w-005/merge-check'
git worktree add --detach $merge fb8947f003c4136c1831c6d758ef578f67de7f31
git -C $merge merge --no-commit --no-ff 90d39cadb27c91d5d2096654f1a02117db615736
git -C $merge write-tree

Run the verification commands from that checkout. Pass the existing virtual environment's Python executable as -DINTAKE_PYTHON:FILEPATH=<path> when configuring and use that same executable for the documentation link check.

Evidence and follow-up

The six RX 7600 inline failures each reported mismatches=41 committed_hit=41 committed_t_plus_tmin=41. At TMin 0.25 this reproduces the pre-change result on the same RX 7600. Pre-change observation

The first mismatch was ray 1. Its candidate-at-commit distance was 1, matching the reference, and its final distance was 1.25 at TMin 0.25 and 1.5 at TMin 0.5. The zero case is a diagnostic control because an added zero leaves the distance unchanged. The fixture's existing synthetic control verifies that a fixed +0.25 committed-distance error fails. Reproduction notes

Checklist

  • This pull request covers one reviewable behavior.
  • The verification commands and results are included.
  • Invalid inputs and the existing distance failure control are covered.
  • The experiment notes document the supported range and sweep commands.
  • The change includes no game files, dumps, distribution links, or secrets.

AI-assisted (Codex and ChatGPT).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6589991752 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1862). Originally posted by [FAJIFBEFJHA](https://github.com/FAJIFBEFJHA) on 2026-11-24T19:44:20Z. --- ## Change Refs #1011 Add an optional `--tmin <value>` to the `--dxr-opacity` and `--dxr-opacity-pipeline` operations of `offscreen_check` so one build can sweep TMin on inline RayQuery and DispatchRays. Both operations print the effective value as `dxr_opacity_tmin`. The CLI accepts finite values in `[0, 0.5]` and rejects invalid arguments with exit code `2` before D3D12 setup. The fixture's intersections lie at distances `1` through `4` in either direction, with `TMax=8`, so the independent reference table applies throughout the supported range. The default remains `0.25`. The four CTest invocations and the strict origin-relative distance checks keep their existing behavior. ## Verification Tested `90d39cadb27c91d5d2096654f1a02117db615736` based on `813045b3c13f7bad20d8577557b621ee869ccbba`. - Windows 11 Pro 26H2 x64 build `26300.9974`, MSVC `19.52.37029.0`, Windows SDK `10.0.26100.0`, DXC `1.8.2502.11`, CMake/CTest `4.3.1-msvc1` and Python `3.13.5`. - AMD Radeon RX 7600 (`1002:7480`, driver `32.0.32029.2010`) and in-box WARP (`1414:008c`, driver `10.0.26100.9818`). Both reported DXR Tier 1.1 and SM 6.5 in the fixture query. The D3D12 debug layer was enabled and reported zero errors and warnings on every DXR run. ```powershell .\tools\dev.ps1 cmake --preset dev cmake --build --preset dev --target offscreen_check --parallel 6 cmake --preset release cmake --build --preset release --target offscreen_check --parallel 4 .\out\build\release\offscreen_check.exe --self-test $env:XBOX2WINDOWS_ADAPTER = 'RX 7600' ctest --preset dev --no-tests=error -j 1 -R '^(offscreen_capability_table_self_test|dxr_opacity_(pipeline_)?(hardware|warp))$' -V .\out\build\dev\offscreen_check.exe hardware --dxr-opacity --tmin nan $LASTEXITCODE .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py git diff --check origin/main...HEAD ``` Both builds and both CLI self-tests passed. CTest reported **3 DXR PASS, 1 known DXR FAIL and 0 SKIP**. `dxr_opacity_hardware` reproduced the 41 committed-distance mismatches at the default TMin, so CTest exited `8`. The DispatchRays hardware test and both WARP tests passed. All four matched their explicit `--tmin 0.25` counterparts. All 29 invalid invocations returned `2` before D3D12 setup, including the NaN example above. The documentation link check and `git diff --check` passed. Run the sweep from the same checkout with the Debug executable: ```powershell $exe = '.\out\build\dev\offscreen_check.exe' foreach ($repeat in 1..3) { foreach ($adapter in 'hardware', 'warp') { foreach ($operation in '--dxr-opacity', '--dxr-opacity-pipeline') { foreach ($tmin in '0', '0.25', '0.5') { & $exe $adapter $operation --tmin $tmin "$repeat $adapter $operation TMin=$tmin exit=$LASTEXITCODE" } } } } ``` | Adapter and path | TMin 0 | TMin 0.25 | TMin 0.5 | | --- | --- | --- | --- | | RX 7600 inline RayQuery | PASS · 0 | FAIL · 41 | FAIL · 41 | | RX 7600 DispatchRays | PASS · 0 | PASS · 0 | PASS · 0 | | WARP inline RayQuery | PASS · 0 | PASS · 0 | PASS · 0 | | WARP DispatchRays | PASS · 0 | PASS · 0 | PASS · 0 | Each cell gives the status and mismatch count per run. The three serial repetitions agreed (30 PASS, 6 FAIL, 0 SKIP). The CPU reference reported 126 rays, 94 hits, 42 shader commits, 32 misses and 36 first-hit rays on every run. WARP inline recorded the existing 11 `warp_after_commit` cases per run. I also repeated the Debug and Release builds, both CLI self-tests, the registered DXR tests, all 36 sweep runs, the 29 invalid invocations and the link check after a local test merge into upstream `fb8947f0`. The upstream change touched a startup wrapper linked by `offscreen_check`. The test merge produced tree `df8578950f9761d41b35a84222ce058e31abcd83` and matched the results above. ```powershell $merge = 'out/x2w-005/merge-check' git worktree add --detach $merge fb8947f003c4136c1831c6d758ef578f67de7f31 git -C $merge merge --no-commit --no-ff 90d39cadb27c91d5d2096654f1a02117db615736 git -C $merge write-tree ``` Run the verification commands from that checkout. Pass the existing virtual environment's Python executable as `-DINTAKE_PYTHON:FILEPATH=<path>` when configuring and use that same executable for the documentation link check. ## Evidence and follow-up The six RX 7600 inline failures each reported `mismatches=41 committed_hit=41 committed_t_plus_tmin=41`. At TMin `0.25` this reproduces the pre-change result on the same RX 7600. [Pre-change observation](https://github.com/R0Y00/Xbox2Windows/issues/1011#issuecomment-7121756811) The first mismatch was ray 1. Its candidate-at-commit distance was `1`, matching the reference, and its final distance was `1.25` at TMin `0.25` and `1.5` at TMin `0.5`. The zero case is a diagnostic control because an added zero leaves the distance unchanged. The fixture's existing synthetic control verifies that a fixed `+0.25` committed-distance error fails. [Reproduction notes](docs/experiments.md#opacity-in-dispatchrays) ## Checklist - [x] This pull request covers one reviewable behavior. - [x] The verification commands and results are included. - [x] Invalid inputs and the existing distance failure control are covered. - [x] The experiment notes document the supported range and sweep commands. - [x] The change includes no game files, dumps, distribution links, or secrets. AI-assisted (Codex and ChatGPT).
tedin7 commented 2026-11-24 20:01:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:49:48Z.

Review: COMMENTED


Review of 90d39cad (merge base 813045b3; origin/main is now 5a6ad936, and git merge-tree merges cleanly). Comment only, not an approval.

Verdict

No P1 or P2 found. The argument parser rejects what it should, and the claim that the reference table holds across the supported range checks out on Linux. Two P3 notes. Clean-room: synthetic geometry and the existing fixture only.

What I ran on Linux

dxr_opacity_reference.h is plain C++, so I built it with g++ 14.2 (-std=c++20) and called first_reference_mismatch(rays(t)):

  • TMin 0, 0.1, 0.25, 0.5, 0.75 and 0.999: the geometric reference agrees with the hand-derived table on all 126 rays.
  • TMin 1 and 1.5: it disagrees from ray 0. The cap of 0.5 is therefore conservative (the real limit is below 1, where a hit at distance 1 stops being inside the interval), which matches the description.

I also copied parse_dxr_opacity_tmin out of offscreen_check.cpp unchanged into a harness (libstdc++, not the MSVC library the author used):

  • 20 inputs behave as the in-tree self-test expects: accepted 0, -0, 0.25, 0.5, 5e-1; rejected "", -0.1, 0.51, 0.50000001, 1, nan, inf, 1e999, 1e-100, 1e-50, 0,25, 0.25x, +0.25, a leading space and 0x1p-2. 0 mismatches.
  • Six one-line mutants of the parser, each killed by an input that the PR's own self-test list also contains: no isfinite (nan), no end != last (0.25x, 0,25), no error check ("", 1e999), > changed to >= (0.5), no negative check (-0.1), and the float-underflow guard (1e-100). Note that nan passes the range tests on its own, so isfinite is doing real work, and the self-test does cover it.

Other reading

  • Signature changes (check_dxr_opacity, rays(nearT), first_reference_mismatch(probes)) have no other callers: git grep finds only dxr_opacity.cpp, offscreen_check.cpp and the header (the facing fixture has its own copy).
  • Both operations now map to one function; --tmin is accepted only for the two opacity ops (--dual-uav --tmin 0.25 is a usage error in the self-test, and 0.25 default is kept for the four CTest entries).
  • The synthetic "injected +0.25" control is a fixed number, independent of nearT, so it keeps failing the same way at any TMin.

P3

  • run_dxr_opacity decides pipeline versus inline by comparing argv[2] to the string --dxr-opacity-pipeline, not by which table entry ran. If an alias or a rename is added to kOperations, the two can disagree and a pipeline run silently becomes inline. Two thin wrappers (as before) would keep that in the table.
  • dxr_opacity_tmin is printed before the reference check, so a run that fails the reference still prints a value; useful, just note it is the requested value, not a measured one.

Commands run (Linux, g++ 14.2, Python 3.14.8)

  • Reference sweep and parser harness as above (sources in a scratch directory outside the repo).
  • python -B tests/docs_links_check.py: Self-test passed. Checked 18 Markdown files and 369 links.
  • python -B tests/bidi_controls_check.py: Self-test passed. Checked 1320 tracked source, script and build/CI files: no bidirectional controls.
  • git diff --check origin/main...HEAD: clean.

Not run

offscreen_check itself, the --self-test, CTest and every D3D12/DXR run (no Windows, MSVC or DXC here). The RX 7600 and WARP tables in the description are the author's results; I did not reproduce them. The parser was checked with libstdc++, whose from_chars can differ from MSVC on out-of-range text; the in-tree self-test is what pins the MSVC behaviour.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6046251685 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1862#pullrequestreview-6046251685). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:49:48Z. **Review:** COMMENTED --- Review of `90d39cad` (merge base `813045b3`; `origin/main` is now `5a6ad936`, and `git merge-tree` merges cleanly). Comment only, not an approval. ## Verdict No P1 or P2 found. The argument parser rejects what it should, and the claim that the reference table holds across the supported range checks out on Linux. Two P3 notes. Clean-room: synthetic geometry and the existing fixture only. ## What I ran on Linux `dxr_opacity_reference.h` is plain C++, so I built it with `g++ 14.2` (`-std=c++20`) and called `first_reference_mismatch(rays(t))`: - TMin 0, 0.1, 0.25, 0.5, 0.75 and 0.999: the geometric reference agrees with the hand-derived table on all 126 rays. - TMin 1 and 1.5: it disagrees from ray 0. The cap of 0.5 is therefore conservative (the real limit is below 1, where a hit at distance 1 stops being inside the interval), which matches the description. I also copied `parse_dxr_opacity_tmin` out of `offscreen_check.cpp` unchanged into a harness (libstdc++, not the MSVC library the author used): - 20 inputs behave as the in-tree self-test expects: accepted `0`, `-0`, `0.25`, `0.5`, `5e-1`; rejected `""`, `-0.1`, `0.51`, `0.50000001`, `1`, `nan`, `inf`, `1e999`, `1e-100`, `1e-50`, `0,25`, `0.25x`, `+0.25`, a leading space and `0x1p-2`. 0 mismatches. - Six one-line mutants of the parser, each killed by an input that the PR's own self-test list also contains: no `isfinite` (nan), no `end != last` (`0.25x`, `0,25`), no `error` check (`""`, `1e999`), `>` changed to `>=` (`0.5`), no negative check (`-0.1`), and the float-underflow guard (`1e-100`). Note that `nan` passes the range tests on its own, so `isfinite` is doing real work, and the self-test does cover it. ## Other reading - Signature changes (`check_dxr_opacity`, `rays(nearT)`, `first_reference_mismatch(probes)`) have no other callers: `git grep` finds only `dxr_opacity.cpp`, `offscreen_check.cpp` and the header (the facing fixture has its own copy). - Both operations now map to one function; `--tmin` is accepted only for the two opacity ops (`--dual-uav --tmin 0.25` is a usage error in the self-test, and `0.25` default is kept for the four CTest entries). - The synthetic "injected +0.25" control is a fixed number, independent of `nearT`, so it keeps failing the same way at any TMin. ## P3 - `run_dxr_opacity` decides pipeline versus inline by comparing `argv[2]` to the string `--dxr-opacity-pipeline`, not by which table entry ran. If an alias or a rename is added to `kOperations`, the two can disagree and a pipeline run silently becomes inline. Two thin wrappers (as before) would keep that in the table. - `dxr_opacity_tmin` is printed before the reference check, so a run that fails the reference still prints a value; useful, just note it is the requested value, not a measured one. ## Commands run (Linux, g++ 14.2, Python 3.14.8) - Reference sweep and parser harness as above (sources in a scratch directory outside the repo). - `python -B tests/docs_links_check.py`: Self-test passed. Checked 18 Markdown files and 369 links. - `python -B tests/bidi_controls_check.py`: Self-test passed. Checked 1320 tracked source, script and build/CI files: no bidirectional controls. - `git diff --check origin/main...HEAD`: clean. ## Not run `offscreen_check` itself, the `--self-test`, CTest and every D3D12/DXR run (no Windows, MSVC or DXC here). The RX 7600 and WARP tables in the description are the author's results; I did not reproduce them. The parser was checked with libstdc++, whose `from_chars` can differ from MSVC on out-of-range text; the in-tree self-test is what pins the MSVC behaviour. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 21:00:57 +00:00
tedin7 commented 2026-11-24 21:00:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:08:36Z.

Review: COMMENTED


Reviewed head 397caf1fe29a1a7209595c6fc662c8d5207cb0a7 in a clean Linux worktree. (The earlier review comment on this PR was for an older commit.)

  • git diff --check origin/main...HEAD: clean (rc 0)
  • python -B tests/docs_links_check.py: rc 0
  • python -B tests/bidi_controls_check.py: rc 0

No Python test is touched. The tests are C++ and Windows-only, so I could not build or run them here. This is source analysis. Win2025 results are still needed.

Findings: 0 P1, 0 P2.

What I checked:

  • parse_dxr_opacity_tmin: from_chars must consume the whole string, so 0.25x, 0,25 and the empty string are refused. It parses as double and bounds-checks before rounding, so 0.50000001 is refused. Non-finite values and 1e999 are refused. A value that rounds to 0.0f without being zero (for example 1e-100) is refused. -0 is normalized to +0.0f.
  • Argument counts: argc 3 gives the default 0.25, and argc 5 needs --tmin. A dangling --tmin, a repeated --tmin and other flags are usage errors. run_dxr_opacity_fixture calls .value() only after validate_dxr_opacity_args has passed.
  • Bounds: [0, 0.5] stays strictly below the nearest hit at distance 1, so the hand-derived table still holds. first_reference_mismatch(probes) and evaluate now use the ray's own nearT, and the same value goes into the GPU ray buffer.
  • The only other caller of check_dxr_opacity and dxr_opacity::rays is offscreen_check.cpp, which the PR updates. The header is self-contained (#pragma once, all inline or constexpr), so including it in offscreen_check.cpp should not cause duplicate definitions.
  • Existing CTest entries keep the default 0.25. The self-test covers the accepted, refused and effective-value cases.
  • The docs loop matches the CLI order (<adapter> <operation> --tmin <value>), and the wording is neutral.

Observation, not a defect: on a conforming driver, any TMin in [0, 0.5] gives identical hits. So the plumbing from the CLI value to the GPU ray buffer shows up only through the committed_t_plus_tmin diagnostic on the affected hardware. The self-test does cover the parsing and bounds.

Suggested Win2025 run: ctest --preset dev --no-tests=error -R '^(offscreen_capability_table_self_test|dxr_opacity_(pipeline_)?(hardware|warp))$' -V. Optionally also offscreen_check.exe warp --dxr-opacity --tmin 0 and --tmin 0.5, and the pipeline variant.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6046539110 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1862#pullrequestreview-6046539110). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T20:08:36Z. **Review:** COMMENTED --- Reviewed head `397caf1fe29a1a7209595c6fc662c8d5207cb0a7` in a clean Linux worktree. (The earlier review comment on this PR was for an older commit.) - `git diff --check origin/main...HEAD`: clean (rc 0) - `python -B tests/docs_links_check.py`: rc 0 - `python -B tests/bidi_controls_check.py`: rc 0 No Python test is touched. The tests are C++ and Windows-only, so I could not build or run them here. This is source analysis. Win2025 results are still needed. **Findings: 0 P1, 0 P2.** What I checked: - `parse_dxr_opacity_tmin`: `from_chars` must consume the whole string, so `0.25x`, `0,25` and the empty string are refused. It parses as double and bounds-checks before rounding, so `0.50000001` is refused. Non-finite values and `1e999` are refused. A value that rounds to 0.0f without being zero (for example `1e-100`) is refused. `-0` is normalized to +0.0f. - Argument counts: argc 3 gives the default 0.25, and argc 5 needs `--tmin`. A dangling `--tmin`, a repeated `--tmin` and other flags are usage errors. `run_dxr_opacity_fixture` calls `.value()` only after `validate_dxr_opacity_args` has passed. - Bounds: `[0, 0.5]` stays strictly below the nearest hit at distance 1, so the hand-derived table still holds. `first_reference_mismatch(probes)` and `evaluate` now use the ray's own `nearT`, and the same value goes into the GPU ray buffer. - The only other caller of `check_dxr_opacity` and `dxr_opacity::rays` is `offscreen_check.cpp`, which the PR updates. The header is self-contained (`#pragma once`, all inline or constexpr), so including it in `offscreen_check.cpp` should not cause duplicate definitions. - Existing CTest entries keep the default 0.25. The self-test covers the accepted, refused and effective-value cases. - The docs loop matches the CLI order (`<adapter> <operation> --tmin <value>`), and the wording is neutral. Observation, not a defect: on a conforming driver, any TMin in `[0, 0.5]` gives identical hits. So the plumbing from the CLI value to the GPU ray buffer shows up only through the `committed_t_plus_tmin` diagnostic on the affected hardware. The self-test does cover the parsing and bounds. Suggested Win2025 run: `ctest --preset dev --no-tests=error -R '^(offscreen_capability_table_self_test|dxr_opacity_(pipeline_)?(hardware|warp))$' -V`. Optionally also `offscreen_check.exe warp --dxr-opacity --tmin 0` and `--tmin 0.5`, and the pipeline variant. AI-assisted; commands listed were executed locally.
FAJIFBEFJHA commented 2026-11-24 21:01:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by FAJIFBEFJHA on 2026-11-24T20:02:08Z.


@tedin7, following up on your review.

Thanks for the review. In 397caf1f, each kOperations entry now selects its own thin wrapper for inline RayQuery or DispatchRays. Both wrappers share the existing TMin parser and fixture call.

Debug and Release builds and CLI self-tests passed. The four DXR CTest results and all 36 sweep runs matched 90d39cad, including the known RX 7600 inline failures at positive TMin.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7142949006 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1862#issuecomment-7142949006). Originally posted by [FAJIFBEFJHA](https://github.com/FAJIFBEFJHA) on 2026-11-24T20:02:08Z. --- @tedin7, following up on [your review](https://github.com/R0Y00/Xbox2Windows/pull/1862#pullrequestreview-6046251685). Thanks for the review. In `397caf1f`, each `kOperations` entry now selects its own thin wrapper for inline RayQuery or DispatchRays. Both wrappers share the existing TMin parser and fixture call. Debug and Release builds and CLI self-tests passed. The four DXR CTest results and all 36 sweep runs matched `90d39cad`, including the known RX 7600 inline failures at positive TMin.
ChazY11 commented 2026-11-24 21:01:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T20:06:32Z.


Ran the CLI on this machine

At the PR head, Windows 11 build 26300.9974, in-box WARP 10.0.26100.9818:

cmake --build --preset dev --target offscreen_check
offscreen_check warp --dxr-opacity --tmin <value>
--tmin exit printed
(omitted) 0 dxr_opacity_tmin=0.25
0 0 dxr_opacity_tmin=0
0.25 0 dxr_opacity_tmin=0.25
0.5 0 dxr_opacity_tmin=0.5
0.5000001 2 —
-1 2 —
nan 2 —
inf 2 —
-0 0 dxr_opacity_tmin=0
--tmin with no value 2 —

So the range is enforced at both ends, the default is unchanged, isfinite rejects nan/inf before D3D12 setup, and the
two boundaries are accepted rather than off-by-one. -0 parsing as 0 and being accepted is correct (it is in range).

Correction on my own first attempt: I first ran offscreen_check --dxr-opacity --tmin 0.5 and got exit 2 for every value,
including the legal ones. That is the parser requiring argc == 5 with argv[3] == "--tmin", i.e. <mode> first — my
invocation was wrong, not the patch. Anyone repeating this should copy the form from CMakeLists.txt line 1517.

Two small things

  1. --tmin is only accepted after the operation name. offscreen_check warp --tmin 0.5 --dxr-opacity presumably fails the
    argv[3] check and exits 2 with the same code as an out-of-range value. That is fine, but the usage error and the range
    error share exit code 2 and (from what I can see) the same path, so a caller scripting a sweep cannot tell "I put the flag in
    the wrong place" from "0.6 is not allowed". If the message distinguishes them on stderr, ignore this note.
  2. The reference table covers [0, 0.5] because of the fixture's distances (1..4, TMax=8), not because of anything the CLI
    enforces.
    That reasoning is in the description and is the right place for it; it might also belong as a comment next to
    the range check, since the next person to widen the range will look there.

Verdict

Reviewed. The feature does what the description says on WARP, the boundaries and the invalid inputs behave, and the default
is untouched. No objections.

Notes

  • AI-assisted review.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7143052376 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1862#issuecomment-7143052376). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T20:06:32Z. --- ## Ran the CLI on this machine At the PR head, Windows 11 build 26300.9974, in-box WARP 10.0.26100.9818: ```powershell cmake --build --preset dev --target offscreen_check offscreen_check warp --dxr-opacity --tmin <value> ``` | `--tmin` | exit | printed | |---|---|---| | (omitted) | 0 | `dxr_opacity_tmin=0.25` | | `0` | 0 | `dxr_opacity_tmin=0` | | `0.25` | 0 | `dxr_opacity_tmin=0.25` | | `0.5` | 0 | `dxr_opacity_tmin=0.5` | | `0.5000001` | 2 | — | | `-1` | 2 | — | | `nan` | 2 | — | | `inf` | 2 | — | | `-0` | 0 | `dxr_opacity_tmin=0` | | `--tmin` with no value | 2 | — | So the range is enforced at both ends, the default is unchanged, `isfinite` rejects `nan`/`inf` before D3D12 setup, and the two boundaries are accepted rather than off-by-one. `-0` parsing as `0` and being accepted is correct (it is in range). **Correction on my own first attempt**: I first ran `offscreen_check --dxr-opacity --tmin 0.5` and got exit 2 for every value, including the legal ones. That is the parser requiring `argc == 5` with `argv[3] == "--tmin"`, i.e. `<mode>` first — my invocation was wrong, not the patch. Anyone repeating this should copy the form from `CMakeLists.txt` line 1517. ## Two small things 1. **`--tmin` is only accepted after the operation name.** `offscreen_check warp --tmin 0.5 --dxr-opacity` presumably fails the `argv[3]` check and exits 2 with the same code as an out-of-range value. That is fine, but the usage error and the range error share exit code 2 and (from what I can see) the same path, so a caller scripting a sweep cannot tell "I put the flag in the wrong place" from "0.6 is not allowed". If the message distinguishes them on stderr, ignore this note. 2. **The reference table covers `[0, 0.5]` because of the fixture's distances (1..4, TMax=8), not because of anything the CLI enforces.** That reasoning is in the description and is the right place for it; it might also belong as a comment next to the range check, since the next person to widen the range will look there. ## Verdict Reviewed. The feature does what the description says on WARP, the boundaries and the invalid inputs behave, and the default is untouched. No objections. ## Notes - AI-assisted review.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1855
No description provided.