D3D12.X: the depth bias of a 16-bit depth buffer is in 24-bit units #2858

Open
tiagonleal wants to merge 2 commits from upstream-pr/2858 into main
tiagonleal commented 2026-11-26 19:13:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T19:13:55Z.


The console's D16_UNORM_S8_UINT (118) has no PC format, so its depth buffers become D24_UNORM_S8_UINT. On a UNORM depth buffer D3D12 applies DepthBias * 2^-n + SlopeScaledDepthBias * MaxDepthSlope (n: depth bits), clamped by DepthBiasClamp. A title's DepthBias meant for a 16-bit buffer (2^-16 a unit) reached the 24-bit one unchanged (2^-24 a unit), so every constant bias on such a buffer was 256 times weaker than on the console. The bias is now scaled by 2^8 for that format. Slope and clamp are not in these units and stay.

Where the bias reaches the PC:

  • pipelines: pc_topology_type, where the DSVFormat becomes the PC's (all graphics paths), and the GS pipeline stream, which passed the rasterizer state on directly
  • pipeline streams: the RASTERIZER / RASTERIZER1 / RASTERIZER2 subobjects of the two-pass mesh and stand-in streams, by the stream's DEPTH_STENCIL_FORMAT wherever it sits. The float bias of RASTERIZER1 / RASTERIZER2 is scaled before it is rounded (-0.5 on a D16S8 buffer becomes -128).
  • dynamic bias: try_native_depth_bias, by the console DSVFormat of the bound pipeline, with the float scaled exactly (-0.5 becomes -128.0, not rounded first). It stores the scaled bias it actually sent, and a pipeline switch or RSSetDepthBias compares the new target scaled for the bound pipeline's format with that stored value, so a compute, untracked or non-dynamic pipeline in between cannot hide a change of format. The patched-PSO fallback scales before rounding and is not scaled a second time.

The scaling applies only while pc_view_format(118) is D24S8. If 118 maps to D32_FLOAT (as in #1649), the unit depends on the primitive's depth exponent and no fixed factor is right, so the scaling turns itself off.

Based on e120925e, the last main commit before #2555 (see Regression run).

Rebased onto main 0fe06eb0, with two adaptations. Conflicts this time were with #2856 and #3292, both merged since: translated_mesh_stream_once now takes its render target formats from stream_rt_formats, and this PR's stream_dsv_format and pc_stream_depth_bias sit after main's new is_uint_dxgi_format; this PR's own lines are unchanged. main's a0762934 added a native route for streams with extended rasterizer state (rewrite_graphics_stream), which copied the bias unscaled; it now scales a D16S8 bias there too (new test a_rewritten_d16s8_stream_gets_its_depth_bias_in_d24_units; without the change it fails with left -0.5, right -128.0). main also gave RASTERIZER_DESC2 its own arm in stream_pipeline, which now records its float bias like RASTERIZER1 (stream_pipeline_defaults_depth_enable_from_dsv_format, type 28: left 0, right -128 without it). The test's StreamPipeline::Graphics pattern has main's second field, which is the build failure @KOLESNiii's merge check found.

What is in it

  • crates/xcl/src/hle/d3d12x/device_x.rs: pc_depth_bias (saturating at the i32 limits), DepthBias::for_dsv, base_dsv_format, the fallback's scaling; new test depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units (integer, fractional and saturating values)
  • crates/xcl/src/hle/d3d12x/real.rs: pc_topology_type, the GS stream, the two-pass mesh stream and fallback_stream use it; stream_pipeline scales the RASTERIZER1 / RASTERIZER2 float (stream_dsv_format, pc_stream_depth_bias); new tests a_d16s8_pipeline_gets_its_depth_bias_in_d24_units and a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order
  • crates/xcl/src/hle/d3d12x/list_x.rs: the native RSSetDepthBias calls and the pipeline-switch resync use it; new tests native_depth_bias_follows_the_bound_pipelines_depth_format and native_depth_bias_resends_after_a_pipeline_that_does_not_sync

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09); debug tests, release build
  • Two defects found in review of 971f766c (pipeline switch with a stale stored bias; float bias of RASTERIZER1/2 streams truncated before scaling) are fixed in 25814cc2 with a test each.
  • cargo test -p xcl --lib -- depth_bias d24_units stream_pipeline_defaults_depth_enable --test-threads=4: 10 passed, 0 failed, 3 of 3 runs on 25814cc2. One of the ten, depth_bias_native_list9_and_bundle_fallback, creates a D3D12 device and ran here (no SKIPPED line). The ten are depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units, depth_bias_patches_rasterizer_fields, depth_bias_state_tracks_fallback_and_clear, native_depth_bias_follows_the_bound_pipelines_depth_format, depth_bias_native_path_exact_f32_and_list9_fallback, native_depth_bias_resends_after_a_pipeline_that_does_not_sync, a_d16s8_pipeline_gets_its_depth_bias_in_d24_units, a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order, stream_pipeline_defaults_depth_enable_from_dsv_format and depth_bias_native_list9_and_bundle_fallback.
  • With the scaling switched off in pc_depth_bias (local change, not committed) on 971f766c, the four scaling tests failed (device_x.rs:1531 left: 4, right: 1024; list_x.rs:5286 left: Some(-3.0), right: Some(-768.0); real.rs:6678 left: (DXGI_FORMAT(45), -8), right: (DXGI_FORMAT(45), -2048); real.rs:6652 left: -8, right: -2048).
  • With the production hunks of 25814cc2 reverted by hand (not committed), the two tests it touches fail: native_depth_bias_resends_after_a_pipeline_that_does_not_sync (list_x.rs:5339, case 0: [-256.0], left: Some(-256.0), right: Some(-1.0)) and stream_pipeline_defaults_depth_enable_from_dsv_format (real.rs:8538, type 27, bias -0.5, D16S8, left: 0, right: -128). Restored, both pass.
  • cargo test --workspace --no-fail-fast -- --test-threads=4, once on 25814cc2: 1443 passed, 4 failed, 47 ignored (25 SKIPPED lines: 21 no wave64, 1 no heap windows, 3 recompiler cases refused as unsupported). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (CreateComputePipelineState returns E_OUTOFMEMORY, 0x8007000E); they fail the same way on e120925e on this machine (cargo test -p xcl --lib fuzz_validate_and_gpu: 0 passed, 4 failed).
  • After the rebase onto main 0fe06eb0 (head c3467c18): cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4, one run: 2743 passed, 0 failed, 49 ignored (27 SKIPPED lines); main 0fe06eb0 on this machine: 2737 passed, 0 failed, 49 ignored. The other results in this section are from the earlier heads named in them.

Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e (Newer Retail Game), release builds of both commits in clean trees, main 0fe06eb0 first, one run each, in one queue with this account's other PRs. Both runs had XCL_PREPARE=0 and the same warm DXIL cache. A warm-up run of main came before them and is not shown. A second run of main at the end of the queue showed 1697 frames and a peak commit of 15618 MB, so differences of under a hundred frames between runs are noise here.

main (0fe06eb0):

xcl-smoke v1
commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1687 (PresentX 1687)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15383 MB

This PR (c3467c18):

xcl-smoke v1
commit: c3467c18e0cccebd224e0ee3c260d3fa3bead52f
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1696 (PresentX 1696)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15718 MB

On the earlier head b1db118d one run of this tree ended at 60 s as usual but its process did not exit. That is the end watchdog going through XCL's own terminate hook with the other threads suspended, which main had then; #2698, merged since, fixed it. It is not related to this PR's change.

Not tested

  • Whether the retail title uses D16_UNORM_S8_UINT with a non-zero depth bias: our logs record neither the depth formats of pipelines nor biases
  • Dynamic bias on pipelines created from a pipeline stream: CreatePipelineState (device_x.rs:618) does not record them (note_base, device_x.rs:218), so their dynamic bias is sent unscaled. The open PR #1661 routes streams through create_graphics_pso_tracked, which would cover them.
  • If the open PR #1649 changes the PC format of 118, the scaling switches itself off; that combination was not run
  • No visual check of shadows or decals in a title
  • A main commit that contains #2555
  • AMD and Intel GPUs

AI use

  • Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5, Claude Sonnet 5.5) helped developing.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5515825809 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T19:13:55Z. --- The console's D16_UNORM_S8_UINT (118) has no PC format, so its depth buffers become D24_UNORM_S8_UINT. On a UNORM depth buffer D3D12 applies `DepthBias * 2^-n + SlopeScaledDepthBias * MaxDepthSlope` (n: depth bits), clamped by `DepthBiasClamp`. A title's `DepthBias` meant for a 16-bit buffer (2^-16 a unit) reached the 24-bit one unchanged (2^-24 a unit), so every constant bias on such a buffer was 256 times weaker than on the console. The bias is now scaled by 2^8 for that format. Slope and clamp are not in these units and stay. Where the bias reaches the PC: - pipelines: `pc_topology_type`, where the DSVFormat becomes the PC's (all graphics paths), and the GS pipeline stream, which passed the rasterizer state on directly - pipeline streams: the RASTERIZER / RASTERIZER1 / RASTERIZER2 subobjects of the two-pass mesh and stand-in streams, by the stream's DEPTH_STENCIL_FORMAT wherever it sits. The float bias of RASTERIZER1 / RASTERIZER2 is scaled before it is rounded (-0.5 on a D16S8 buffer becomes -128). - dynamic bias: `try_native_depth_bias`, by the console DSVFormat of the bound pipeline, with the float scaled exactly (-0.5 becomes -128.0, not rounded first). It stores the scaled bias it actually sent, and a pipeline switch or `RSSetDepthBias` compares the new target scaled for the bound pipeline's format with that stored value, so a compute, untracked or non-dynamic pipeline in between cannot hide a change of format. The patched-PSO fallback scales before rounding and is not scaled a second time. The scaling applies only while `pc_view_format(118)` is D24S8. If 118 maps to D32_FLOAT (as in #1649), the unit depends on the primitive's depth exponent and no fixed factor is right, so the scaling turns itself off. Based on `e120925e`, the last `main` commit before #2555 (see Regression run). *Rebased onto `main` `0fe06eb0`, with two adaptations.* Conflicts this time were with #2856 and #3292, both merged since: `translated_mesh_stream_once` now takes its render target formats from `stream_rt_formats`, and this PR's `stream_dsv_format` and `pc_stream_depth_bias` sit after `main`'s new `is_uint_dxgi_format`; this PR's own lines are unchanged. `main`'s a0762934 added a native route for streams with extended rasterizer state (`rewrite_graphics_stream`), which copied the bias unscaled; it now scales a D16S8 bias there too (new test `a_rewritten_d16s8_stream_gets_its_depth_bias_in_d24_units`; without the change it fails with left -0.5, right -128.0). `main` also gave RASTERIZER_DESC2 its own arm in `stream_pipeline`, which now records its float bias like RASTERIZER1 (`stream_pipeline_defaults_depth_enable_from_dsv_format`, type 28: left 0, right -128 without it). The test's `StreamPipeline::Graphics` pattern has `main`'s second field, which is the build failure @KOLESNiii's merge check found. **What is in it** - `crates/xcl/src/hle/d3d12x/device_x.rs`: `pc_depth_bias` (saturating at the i32 limits), `DepthBias::for_dsv`, `base_dsv_format`, the fallback's scaling; new test `depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units` (integer, fractional and saturating values) - `crates/xcl/src/hle/d3d12x/real.rs`: `pc_topology_type`, the GS stream, the two-pass mesh stream and `fallback_stream` use it; `stream_pipeline` scales the RASTERIZER1 / RASTERIZER2 float (`stream_dsv_format`, `pc_stream_depth_bias`); new tests `a_d16s8_pipeline_gets_its_depth_bias_in_d24_units` and `a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order` - `crates/xcl/src/hle/d3d12x/list_x.rs`: the native `RSSetDepthBias` calls and the pipeline-switch resync use it; new tests `native_depth_bias_follows_the_bound_pipelines_depth_format` and `native_depth_bias_resends_after_a_pipeline_that_does_not_sync` **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09); debug tests, release build - Two defects found in review of 971f766c (pipeline switch with a stale stored bias; float bias of RASTERIZER1/2 streams truncated before scaling) are fixed in 25814cc2 with a test each. - `cargo test -p xcl --lib -- depth_bias d24_units stream_pipeline_defaults_depth_enable --test-threads=4`: 10 passed, 0 failed, 3 of 3 runs on 25814cc2. One of the ten, `depth_bias_native_list9_and_bundle_fallback`, creates a D3D12 device and ran here (no SKIPPED line). The ten are `depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units`, `depth_bias_patches_rasterizer_fields`, `depth_bias_state_tracks_fallback_and_clear`, `native_depth_bias_follows_the_bound_pipelines_depth_format`, `depth_bias_native_path_exact_f32_and_list9_fallback`, `native_depth_bias_resends_after_a_pipeline_that_does_not_sync`, `a_d16s8_pipeline_gets_its_depth_bias_in_d24_units`, `a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order`, `stream_pipeline_defaults_depth_enable_from_dsv_format` and `depth_bias_native_list9_and_bundle_fallback`. - With the scaling switched off in `pc_depth_bias` (local change, not committed) on 971f766c, the four scaling tests failed (device_x.rs:1531 `left: 4, right: 1024`; list_x.rs:5286 `left: Some(-3.0), right: Some(-768.0)`; real.rs:6678 `left: (DXGI_FORMAT(45), -8), right: (DXGI_FORMAT(45), -2048)`; real.rs:6652 `left: -8, right: -2048`). - With the production hunks of 25814cc2 reverted by hand (not committed), the two tests it touches fail: `native_depth_bias_resends_after_a_pipeline_that_does_not_sync` (list_x.rs:5339, `case 0: [-256.0]`, `left: Some(-256.0), right: Some(-1.0)`) and `stream_pipeline_defaults_depth_enable_from_dsv_format` (real.rs:8538, `type 27, bias -0.5, D16S8`, `left: 0, right: -128`). Restored, both pass. - `cargo test --workspace --no-fail-fast -- --test-threads=4`, once on 25814cc2: 1443 passed, 4 failed, 47 ignored (25 `SKIPPED` lines: 21 `no wave64`, 1 `no heap windows`, 3 recompiler cases refused as unsupported). The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (`CreateComputePipelineState` returns E_OUTOFMEMORY, 0x8007000E); they fail the same way on `e120925e` on this machine (`cargo test -p xcl --lib fuzz_validate_and_gpu`: 0 passed, 4 failed). - After the rebase onto `main` `0fe06eb0` (head `c3467c18`): `cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4`, one run: 2743 passed, 0 failed, 49 ignored (27 `SKIPPED` lines); `main` `0fe06eb0` on this machine: 2737 passed, 0 failed, 49 ignored. The other results in this section are from the earlier heads named in them. **Regression run** `scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e` (Newer Retail Game), release builds of both commits in clean trees, `main` `0fe06eb0` first, one run each, in one queue with this account's other PRs. Both runs had `XCL_PREPARE=0` and the same warm DXIL cache. A warm-up run of `main` came before them and is not shown. A second run of `main` at the end of the queue showed 1697 frames and a peak commit of 15618 MB, so differences of under a hundred frames between runs are noise here. `main` (`0fe06eb0`): ``` xcl-smoke v1 commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1687 (PresentX 1687) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15383 MB ``` This PR (`c3467c18`): ``` xcl-smoke v1 commit: c3467c18e0cccebd224e0ee3c260d3fa3bead52f gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1696 (PresentX 1696) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15718 MB ``` On the earlier head `b1db118d` one run of this tree ended at 60 s as usual but its process did not exit. That is the end watchdog going through XCL's own terminate hook with the other threads suspended, which `main` had then; #2698, merged since, fixed it. It is not related to this PR's change. **Not tested** - Whether the retail title uses D16_UNORM_S8_UINT with a non-zero depth bias: our logs record neither the depth formats of pipelines nor biases - Dynamic bias on pipelines created from a pipeline stream: `CreatePipelineState` (`device_x.rs:618`) does not record them (`note_base`, `device_x.rs:218`), so their dynamic bias is sent unscaled. The open PR #1661 routes streams through `create_graphics_pso_tracked`, which would cover them. - If the open PR #1649 changes the PC format of 118, the scaling switches itself off; that combination was not run - No visual check of shadows or decals in a title - A `main` commit that contains #2555 - AMD and Intel GPUs **AI use** - Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5, Claude Sonnet 5.5) helped developing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MatyEjsr commented 2026-11-26 20:15:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MatyEjsr on 2026-11-26T20:15:30Z.


Updated verification and code review of PR #2858 at head 25814cc264c041797ab8a542cdeed30416244a40 (2 commits; merge-base e120925e3abc9956a8b9bae631969d32e8ccd43c, cleanly mergeable onto origin/main 8b957bec; not superseded on origin/nvidia-dev eae01502; no duplicate open PRs or merged redos found).

Both findings from our earlier review of 971f766cc9f442bc71623b2390bc285a63cdb456 are verified fixed in 25814cc264c041797ab8a542cdeed30416244a40 (no remaining findings):

  1. crates/xcl/src/hle/d3d12x/list_x.rs: try_native_depth_bias now scales by the bound pipeline's console DSVFormat and stores the PC-scaled DepthBias in s.native_bias, and on_set_pipeline_state / set_depth_bias_x compare target.for_dsv(device_x::base_dsv_format(...)) != s.native_bias. Verified by native_depth_bias_resends_after_a_pipeline_that_does_not_sync across both format transitions with intervening non-dynamic and compute pipelines.
  2. crates/xcl/src/hle/d3d12x/real.rs: stream_pipeline now retains float_bias for RASTERIZER1 (27) / RASTERIZER2 (28) (cleared on RASTERIZER 10) and scales via DepthBias::for_dsv before rounding to i32 for D16_UNORM_S8_UINT (118). Verified by the extended stream_pipeline_defaults_depth_enable_from_dsv_format assertions (-0.5, 0.4, 1.5 on 118 and 45 for types 27 and 28).

Tested

  • Windows 11 Pro for Workstations (10.0.26200, build 26200), AMD Ryzen 7 7800X3D, 32 GB RAM, NVIDIA GeForce RTX 3090 24 GB (driver 32.0.16.1742 / 617.42), rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9(5512-01b62ad4)(1.9.0.5512); debug build for tests, release build for smoke.
  • cargo test -p xcl --lib -- depth_bias d24_units stream_pipeline_defaults_depth_enable_from_dsv_format --test-threads=4 --show-output: 10 passed, 0 failed, 0 ignored, 0 SKIPPED (depth_bias_native_list9_and_bundle_fallback ran natively on ID3D12GraphicsCommandList9::RSSetDepthBias).
  • cargo test --workspace -j 8 --no-fail-fast -- --test-threads=8 --show-output: 1447 passed, 0 failed, 47 ignored across all workspace test targets, with 28 SKIPPED lines (not counted as passing coverage): 21 no wave64, 3 wave32, per-lane form: refused (unsupported), 3 no D3D12 debug layer, and 1 no heap windows.

Regression run
60 s retail smoke run (-Seconds 60 -Title c1cc91a4, default settings, shared DXIL cache, Windows Developer Mode enabled), comparing exact merge-base main (e120925e3abc9956a8b9bae631969d32e8ccd43c) against PR #2858 (25814cc264c041797ab8a542cdeed30416244a40):

main:

xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 3090
title: c1cc91a4
seconds: 60
exit: 0x0
frames shown: 1589 (PresentX 1589)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13964 MB

PR #2858:

xcl-smoke v1
commit: 25814cc264c041797ab8a542cdeed30416244a40
gpu: NVIDIA GeForce RTX 3090
title: c1cc91a4
seconds: 60
exit: 0x0
frames shown: 1581 (PresentX 1581)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 13992 MB

No regressions observed (99.5% of baseline frames, 100.2% peak commit, 0 device removals, 0 crashes).

Not tested

  • AMD / native wave64 GPUs and the 28 skipped tests on this RTX 3090 adapter (no wave64, refused wave32 per-lane forms, missing d3d12SDKLayers.dll, no heap windows).
  • Whether the retail smoke title uses D16_UNORM_S8_UINT (118) with non-zero depth bias, or visual inspection of shadows/decals.
  • origin/main head 8b957bec (#2555 startup shader preparation; smoke comparison used exact merge-base e120925e).

AI use

  • Antigravity (agy) with gemini-pro-orchestrator-argon (audited by gemini-pro-orchestrator-argon): verified PR #2858 head 25814cc264c041797ab8a542cdeed30416244a40 on RTX 3090 (full workspace suite, targeted depth-bias and stream tests, 60 s retail smoke run), confirmed both earlier review findings fixed, and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7202467107 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7202467107). Originally posted by [MatyEjsr](https://github.com/MatyEjsr) on 2026-11-26T20:15:30Z. --- Updated verification and code review of PR #2858 at head `25814cc264c041797ab8a542cdeed30416244a40` (2 commits; merge-base `e120925e3abc9956a8b9bae631969d32e8ccd43c`, cleanly mergeable onto `origin/main` `8b957bec`; not superseded on `origin/nvidia-dev` `eae01502`; no duplicate open PRs or merged redos found). Both findings from our earlier review of `971f766cc9f442bc71623b2390bc285a63cdb456` are verified fixed in `25814cc264c041797ab8a542cdeed30416244a40` (no remaining findings): 1. **`crates/xcl/src/hle/d3d12x/list_x.rs`:** `try_native_depth_bias` now scales by the bound pipeline's console `DSVFormat` and stores the PC-scaled `DepthBias` in `s.native_bias`, and `on_set_pipeline_state` / `set_depth_bias_x` compare `target.for_dsv(device_x::base_dsv_format(...)) != s.native_bias`. Verified by `native_depth_bias_resends_after_a_pipeline_that_does_not_sync` across both format transitions with intervening non-dynamic and compute pipelines. 2. **`crates/xcl/src/hle/d3d12x/real.rs`:** `stream_pipeline` now retains `float_bias` for `RASTERIZER1` (`27`) / `RASTERIZER2` (`28`) (cleared on `RASTERIZER` `10`) and scales via `DepthBias::for_dsv` before rounding to `i32` for `D16_UNORM_S8_UINT` (`118`). Verified by the extended `stream_pipeline_defaults_depth_enable_from_dsv_format` assertions (`-0.5`, `0.4`, `1.5` on `118` and `45` for types `27` and `28`). **Tested** - Windows 11 Pro for Workstations (10.0.26200, build 26200), AMD Ryzen 7 7800X3D, 32 GB RAM, NVIDIA GeForce RTX 3090 24 GB (driver 32.0.16.1742 / 617.42), rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9(5512-01b62ad4)(1.9.0.5512); debug build for tests, release build for smoke. - `cargo test -p xcl --lib -- depth_bias d24_units stream_pipeline_defaults_depth_enable_from_dsv_format --test-threads=4 --show-output`: **10 passed, 0 failed, 0 ignored**, 0 `SKIPPED` (`depth_bias_native_list9_and_bundle_fallback` ran natively on `ID3D12GraphicsCommandList9::RSSetDepthBias`). - `cargo test --workspace -j 8 --no-fail-fast -- --test-threads=8 --show-output`: **1447 passed, 0 failed, 47 ignored** across all workspace test targets, with **28 `SKIPPED` lines** (not counted as passing coverage): 21 `no wave64`, 3 `wave32, per-lane form: refused (unsupported)`, 3 `no D3D12 debug layer`, and 1 `no heap windows`. **Regression run** 60 s retail smoke run (`-Seconds 60 -Title c1cc91a4`, default settings, shared DXIL cache, Windows Developer Mode enabled), comparing exact merge-base `main` (`e120925e3abc9956a8b9bae631969d32e8ccd43c`) against PR #2858 (`25814cc264c041797ab8a542cdeed30416244a40`): `main`: ``` xcl-smoke v1 commit: e120925e3abc9956a8b9bae631969d32e8ccd43c gpu: NVIDIA GeForce RTX 3090 title: c1cc91a4 seconds: 60 exit: 0x0 frames shown: 1589 (PresentX 1589) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13964 MB ``` PR #2858: ``` xcl-smoke v1 commit: 25814cc264c041797ab8a542cdeed30416244a40 gpu: NVIDIA GeForce RTX 3090 title: c1cc91a4 seconds: 60 exit: 0x0 frames shown: 1581 (PresentX 1581) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 13992 MB ``` No regressions observed (99.5% of baseline frames, 100.2% peak commit, 0 device removals, 0 crashes). **Not tested** - AMD / native wave64 GPUs and the 28 skipped tests on this RTX 3090 adapter (`no wave64`, refused wave32 per-lane forms, missing `d3d12SDKLayers.dll`, `no heap windows`). - Whether the retail smoke title uses `D16_UNORM_S8_UINT` (`118`) with non-zero depth bias, or visual inspection of shadows/decals. - `origin/main` head `8b957bec` (#2555 startup shader preparation; smoke comparison used exact merge-base `e120925e`). **AI use** - Antigravity (agy) with gemini-pro-orchestrator-argon (audited by gemini-pro-orchestrator-argon): verified PR #2858 head `25814cc264c041797ab8a542cdeed30416244a40` on RTX 3090 (full workspace suite, targeted depth-bias and stream tests, 60 s retail smoke run), confirmed both earlier review findings fixed, and wrote this report.
Decodere commented 2026-11-26 20:27:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T20:27:17Z.


Independent desktop NVIDIA verification of PR #2858 at head 971f766cc9f442bc71623b2390bc285a63cdb456 (1 commit; exact parent & merge-base: e120925e3abc9956a8b9bae631969d32e8ccd43c, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (971f766c)

Command Result
cargo test --release -p xcl --lib depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units -- --nocapture 1 passed; 0 failed; 0 ignored; 1345 filtered out (0.00s)
cargo test --release -p xcl --lib native_depth_bias_follows_the_bound_pipelines_depth_format -- --nocapture 1 passed; 0 failed; 0 ignored; 1345 filtered out (0.00s)
cargo test --release -p xcl --lib a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order -- --nocapture 1 passed; 0 failed; 0 ignored; 1345 filtered out (0.00s)
cargo test --release -p xcl --lib a_d16s8_pipeline_gets_its_depth_bias_in_d24_units -- --nocapture 1 passed; 0 failed; 0 ignored; 1345 filtered out (0.00s)
cargo test --release -p xcl --lib hle::d3d12x::device_x:: (3 consecutive runs) 15 passed; 0 failed; 0 ignored; 1331 filtered out × 3 (0.20s, 0.17s, 0.20s)
cargo test --release -p xcl --lib hle::d3d12x::list_x:: 41 passed; 0 failed; 0 ignored; 1305 filtered out (0.68s)
cargo test --release -p xcl --lib hle::d3d12x::real:: 65 passed; 0 failed; 0 ignored; 1281 filtered out (0.36s)
cargo build --release -p xcl --bin xcl Clean build (1m 09s, exit 0)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):

xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB

PR #2858 (971f766cc9f442bc71623b2390bc285a63cdb456):

xcl-smoke v1
commit: 971f766cc9f442bc71623b2390bc285a63cdb456
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1599 (PresentX 1599)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13970 MB

Runtime log observations (xcl.log)

  • 9222 log lines, 0 [ERROR] / device-removal / panic lines.
  • Confirmed native dynamic depth-bias path active on RTX 4060: D3D12.X: native dynamic depth bias (OPTIONS16): supported (ID3D12GraphicsCommandList9::RSSetDepthBias).
  • Final draw/memory telemetry in log: 19543 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 13970 MB committed by the process; video memory 6115 MB local, 4651 MB non-local.

Limits of coverage

  • RTX 4060 supports OPTIONS16 native dynamic depth bias (ID3D12GraphicsCommandList9::RSSetDepthBias), so the 60 s retail smoke exercised the native dynamic depth-bias hardware path rather than the derived/patched-PSO fallback path on GPU.
  • Visual or pixel-level comparison on a title rendering into D16_UNORM_S8_UINT (118) depth buffers with non-zero constant DepthBias was not performed; ×256 scaling, saturation, stream subobject ordering, pipeline-switch re-emission, and patched-PSO handling were verified via the 4 new unit tests and the full device_x::, list_x::, and real:: suites, while the 60 s smoke confirms clean graphics execution and zero regression on title: 29640639.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7202702607 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7202702607). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T20:27:17Z. --- Independent desktop NVIDIA verification of **PR #2858** at head `971f766cc9f442bc71623b2390bc285a63cdb456` (`1` commit; exact parent & merge-base: `e120925e3abc9956a8b9bae631969d32e8ccd43c`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`971f766c`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1345 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib native_depth_bias_follows_the_bound_pipelines_depth_format -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1345 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1345 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib a_d16s8_pipeline_gets_its_depth_bias_in_d24_units -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1345 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib hle::d3d12x::device_x::` (3 consecutive runs) | `15 passed; 0 failed; 0 ignored; 1331 filtered out` × 3 (`0.20s`, `0.17s`, `0.20s`) | | `cargo test --release -p xcl --lib hle::d3d12x::list_x::` | `41 passed; 0 failed; 0 ignored; 1305 filtered out` (`0.68s`) | | `cargo test --release -p xcl --lib hle::d3d12x::real::` | `65 passed; 0 failed; 0 ignored; 1281 filtered out` (`0.36s`) | | `cargo build --release -p xcl --bin xcl` | Clean build (`1m 09s`, exit `0`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`e120925e3abc9956a8b9bae631969d32e8ccd43c`, cached baseline on the same machine): ``` xcl-smoke v1 commit: e120925e3abc9956a8b9bae631969d32e8ccd43c gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13979 MB ``` PR #2858 (`971f766cc9f442bc71623b2390bc285a63cdb456`): ``` xcl-smoke v1 commit: 971f766cc9f442bc71623b2390bc285a63cdb456 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1599 (PresentX 1599) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13970 MB ``` ### Runtime log observations (`xcl.log`) - `9222` log lines, `0` `[ERROR]` / device-removal / panic lines. - Confirmed native dynamic depth-bias path active on RTX 4060: `D3D12.X: native dynamic depth bias (OPTIONS16): supported (ID3D12GraphicsCommandList9::RSSetDepthBias)`. - Final draw/memory telemetry in log: `19543 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `13970 MB committed by the process; video memory 6115 MB local, 4651 MB non-local`. ### Limits of coverage - RTX 4060 supports `OPTIONS16` native dynamic depth bias (`ID3D12GraphicsCommandList9::RSSetDepthBias`), so the 60 s retail smoke exercised the native dynamic depth-bias hardware path rather than the derived/patched-PSO fallback path on GPU. - Visual or pixel-level comparison on a title rendering into `D16_UNORM_S8_UINT` (`118`) depth buffers with non-zero constant `DepthBias` was not performed; `×256` scaling, saturation, stream subobject ordering, pipeline-switch re-emission, and patched-PSO handling were verified via the 4 new unit tests and the full `device_x::`, `list_x::`, and `real::` suites, while the 60 s smoke confirms clean graphics execution and zero regression on `title: 29640639`. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
tiagonleal commented 2026-11-26 20:32:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T20:32:56Z.


Both findings confirmed on 971f766c and fixed in 25814cc2, a new commit on top (971f766c stays an ancestor).

  1. try_native_depth_bias now stores the scaled bias it sent in native_bias. on_set_pipeline_state and set_depth_bias_x compare target.for_dsv(<bound pipeline's DSV>) with it, so a compute, untracked or non-dynamic pipeline in between no longer hides a format change. The new test native_depth_bias_resends_after_a_pipeline_that_does_not_sync runs your sequence in both orders and fails on 971f766c (-256.0 kept instead of -1.0).
  2. stream_pipeline keeps the RASTERIZER1/2 float and, for 118, sets round(for_dsv(bias)) after pc_topology_type. The stream test now covers -0.5, 0.4 and 1.5 on 118 and 45 for both subobjects; it fails on 971f766c (0 instead of -128).

Ran on 25814cc2: the depth-bias tests 3 times (10 passed each, including the device test depth_bias_native_list9_and_bundle_fallback), the full workspace suite (1443 passed, 4 failed: the fuzz_validate_and_gpu_0..3 E_OUTOFMEMORY ones that also fail on e120925e), and the smoke on both commits (1614 frames each, no device removals). PR description updated.

AI use: Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) wrote this; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7202812777 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7202812777). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T20:32:56Z. --- Both findings confirmed on 971f766c and fixed in 25814cc2, a new commit on top (971f766c stays an ancestor). 1. `try_native_depth_bias` now stores the scaled bias it sent in `native_bias`. `on_set_pipeline_state` and `set_depth_bias_x` compare `target.for_dsv(<bound pipeline's DSV>)` with it, so a compute, untracked or non-dynamic pipeline in between no longer hides a format change. The new test `native_depth_bias_resends_after_a_pipeline_that_does_not_sync` runs your sequence in both orders and fails on 971f766c (-256.0 kept instead of -1.0). 2. `stream_pipeline` keeps the RASTERIZER1/2 float and, for 118, sets `round(for_dsv(bias))` after `pc_topology_type`. The stream test now covers -0.5, 0.4 and 1.5 on 118 and 45 for both subobjects; it fails on 971f766c (0 instead of -128). Ran on 25814cc2: the depth-bias tests 3 times (10 passed each, including the device test `depth_bias_native_list9_and_bundle_fallback`), the full workspace suite (1443 passed, 4 failed: the `fuzz_validate_and_gpu_0..3` E_OUTOFMEMORY ones that also fail on e120925e), and the smoke on both commits (1614 frames each, no device removals). PR description updated. AI use: Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) wrote this; I checked it.
Aniseto commented 2026-11-26 20:46:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-26T20:46:04Z.


Ran the D16S8 depth-bias tests at 25814cc on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib a_d16s8 -- --test-threads=1
2 passed; 0 failed; 0 ignored; 0 measured; 1345 filtered out      (exit 0)

Both pass: a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order and a_d16s8_pipeline_gets_its_depth_bias_in_d24_units. These are CPU-side stream/pipeline tests; they do not create a D3D12 device. The thread has a desktop NVIDIA report at the earlier head 971f766c (Decodere) and a review at that head; this is a run at the current head 25814cc, which adds the dynamic-bias resend after a pipeline that does not sync.

Not tested: the dynamic depth-bias path on a real device, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7203052009 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7203052009). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-26T20:46:04Z. --- Ran the D16S8 depth-bias tests at `25814cc` on an NVIDIA Blackwell desktop part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=NVIDIA cargo test -p xcl --lib a_d16s8 -- --test-threads=1 2 passed; 0 failed; 0 ignored; 0 measured; 1345 filtered out (exit 0) ``` Both pass: `a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order` and `a_d16s8_pipeline_gets_its_depth_bias_in_d24_units`. These are CPU-side stream/pipeline tests; they do not create a D3D12 device. The thread has a desktop NVIDIA report at the earlier head `971f766c` (Decodere) and a review at that head; this is a run at the current head `25814cc`, which adds the dynamic-bias resend after a pipeline that does not sync. Not tested: the dynamic depth-bias path on a real device, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Decodere commented 2026-11-26 22:16:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T22:16:47Z.


Follow-up independent desktop NVIDIA verification of PR #2858 at updated head 25814cc264c041797ab8a542cdeed30416244a40 (2 commits 971f766c -> 25814cc2 on merge-base e120925e3abc9956a8b9bae631969d32e8ccd43c, pre-#2555 ancestor of main; parent 971f766cc9f442bc71623b2390bc285a63cdb456). This supersedes our earlier check at 971f766c after the follow-up commit (25814cc2, resend the scaled depth bias after a pipeline that does not sync).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (25814cc2)

Command Result
cargo test --release -p xcl --lib depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units -- --nocapture 1 passed; 0 failed; 0 ignored; 1346 filtered out (0.00s)
cargo test --release -p xcl --lib native_depth_bias_follows_the_bound_pipelines_depth_format -- --nocapture 1 passed; 0 failed; 0 ignored; 1346 filtered out (0.00s)
cargo test --release -p xcl --lib native_depth_bias_resends_after_a_pipeline_that_does_not_sync -- --nocapture 1 passed; 0 failed; 0 ignored; 1346 filtered out (0.00s)
cargo test --release -p xcl --lib a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order -- --nocapture 1 passed; 0 failed; 0 ignored; 1346 filtered out (0.00s)
cargo test --release -p xcl --lib a_d16s8_pipeline_gets_its_depth_bias_in_d24_units -- --nocapture 1 passed; 0 failed; 0 ignored; 1346 filtered out (0.00s)
cargo test --release -p xcl --lib hle::d3d12x::device_x:: (3 consecutive runs) 15 passed; 0 failed; 0 ignored; 1332 filtered out × 3 (0.18s, 0.17s, 0.17s)
cargo test --release -p xcl --lib hle::d3d12x::list_x:: 42 passed; 0 failed; 0 ignored; 1305 filtered out (0.68s)
cargo test --release -p xcl --lib hle::d3d12x::real:: 65 passed; 0 failed; 0 ignored; 1282 filtered out (0.35s)
cargo build --release -p xcl --bin xcl Clean build (1m 08s, exit 0)

Paired quiet 60 s retail smoke (title: 29640639)

Merge-base (e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):

xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB

PR #2858 (25814cc264c041797ab8a542cdeed30416244a40):

xcl-smoke v1
commit: 25814cc264c041797ab8a542cdeed30416244a40
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1601 (PresentX 1601)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14028 MB

Runtime log observations (xcl.log)

  • 9223 log lines, 0 [ERROR] / device-removal / panic lines.
  • Confirmed native dynamic depth bias active on RTX 4060: D3D12.X: native dynamic depth bias (OPTIONS16): supported (ID3D12GraphicsCommandList9::RSSetDepthBias).
  • Final draw/memory telemetry in log: 19543 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14028 MB committed by the process; video memory 6116 MB local, 4683 MB non-local.

Limits of coverage

  • RTX 4060 exposes OPTIONS16 native dynamic depth bias (ID3D12GraphicsCommandList9::RSSetDepthBias), so the 60 s retail smoke exercised the native dynamic path rather than the derived/patched-PSO fallback path on GPU.
  • Re-emission after non-syncing pipelines (native_depth_bias_resends_after_a_pipeline_that_does_not_sync) and D16-to-D24 ×256 scaling/ordering semantics were verified via all 5 targeted unit tests plus full device_x::, list_x::, and real:: suites; no visual/pixel-level inspection on a console title using D16_UNORM_S8_UINT (118) depth buffers with non-zero constant DepthBias was performed.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7204529777 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7204529777). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T22:16:47Z. --- Follow-up independent desktop NVIDIA verification of **PR #2858** at updated head `25814cc264c041797ab8a542cdeed30416244a40` (`2` commits `971f766c -> 25814cc2` on merge-base `e120925e3abc9956a8b9bae631969d32e8ccd43c`, pre-`#2555` ancestor of `main`; parent `971f766cc9f442bc71623b2390bc285a63cdb456`). This supersedes our earlier check at `971f766c` after the follow-up commit (`25814cc2`, *resend the scaled depth bias after a pipeline that does not sync*). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`25814cc2`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib depth_bias_of_a_16_bit_depth_buffer_is_in_24_bit_units -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1346 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib native_depth_bias_follows_the_bound_pipelines_depth_format -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1346 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib native_depth_bias_resends_after_a_pipeline_that_does_not_sync -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1346 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib a_d16s8_stream_gets_its_depth_bias_in_d24_units_in_either_order -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1346 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib a_d16s8_pipeline_gets_its_depth_bias_in_d24_units -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1346 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib hle::d3d12x::device_x::` (3 consecutive runs) | `15 passed; 0 failed; 0 ignored; 1332 filtered out` × 3 (`0.18s`, `0.17s`, `0.17s`) | | `cargo test --release -p xcl --lib hle::d3d12x::list_x::` | `42 passed; 0 failed; 0 ignored; 1305 filtered out` (`0.68s`) | | `cargo test --release -p xcl --lib hle::d3d12x::real::` | `65 passed; 0 failed; 0 ignored; 1282 filtered out` (`0.35s`) | | `cargo build --release -p xcl --bin xcl` | Clean build (`1m 08s`, exit `0`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Merge-base (`e120925e3abc9956a8b9bae631969d32e8ccd43c`, cached baseline on the same machine): ``` xcl-smoke v1 commit: e120925e3abc9956a8b9bae631969d32e8ccd43c gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13979 MB ``` PR #2858 (`25814cc264c041797ab8a542cdeed30416244a40`): ``` xcl-smoke v1 commit: 25814cc264c041797ab8a542cdeed30416244a40 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1601 (PresentX 1601) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14028 MB ``` ### Runtime log observations (`xcl.log`) - `9223` log lines, `0` `[ERROR]` / device-removal / panic lines. - Confirmed native dynamic depth bias active on RTX 4060: `D3D12.X: native dynamic depth bias (OPTIONS16): supported (ID3D12GraphicsCommandList9::RSSetDepthBias)`. - Final draw/memory telemetry in log: `19543 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14028 MB committed by the process; video memory 6116 MB local, 4683 MB non-local`. ### Limits of coverage - RTX 4060 exposes `OPTIONS16` native dynamic depth bias (`ID3D12GraphicsCommandList9::RSSetDepthBias`), so the 60 s retail smoke exercised the native dynamic path rather than the derived/patched-PSO fallback path on GPU. - Re-emission after non-syncing pipelines (`native_depth_bias_resends_after_a_pipeline_that_does_not_sync`) and D16-to-D24 `×256` scaling/ordering semantics were verified via all 5 targeted unit tests plus full `device_x::`, `list_x::`, and `real::` suites; no visual/pixel-level inspection on a console title using `D16_UNORM_S8_UINT` (`118`) depth buffers with non-zero constant `DepthBias` was performed. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
SzczepanGrela commented 2026-11-27 02:42:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-27T02:42:04Z.


RX 9070 / RADV / Wine pixel-readback comparison at 25814cc2: the head and its integration onto current main match the explicit PC depth-bias reference in all 36 synthetic raster cases. Main differs in 8 of 36 cases. All results repeat identically across three fresh processes per source.

Tested

  • Exact head 25814cc264c041797ab8a542cdeed30416244a40, main 8b957bec6f82495aec940944c6bf47faa02db590, and a separate copy with the PR integrated onto that main. The three changed files on main match merge-base e120925e3abc9956a8b9bae631969d32e8ccd43c; the integrated files match the head. Local changes are test-only helpers/observations and the owned raster fixture. Original assertions are unchanged.
  • RX 9070 16 GB, RADV GFX1201, Mesa 26.3.1-arch3.5; Ryzen 7 7700, CachyOS 7.3.0-5-cachyos. Windows GNU release executables through GE-Proton11-12 / Wine 11.0 Staging, native D3D12 through vkd3d-proton 8293130ebe370b1+ (local asserts-disabled build). DXC/DXIL 1.9.2602.17, Rust 1.97.1. Adapter PCI 1002:7550 / LUID 00000000:000003ef verified. OPTIONS16 dynamic depth bias and List9 are available.
  • Build each copy: cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics.
  • Original executable filters: depth_bias stream_pipeline_defaults_depth_enable_from_dsv_format --nocapture --test-threads=1, then --test-threads=4. Main: 5 passed, 0 failed each; exact head and integrated head: 10 passed, 0 failed each. The count difference is the PR's five new tests. The original native List9 test reports support and the same RX 9070 LUID.
  • Owned filter workflow_d16_bias_raster --nocapture --test-threads=1, three repetitions per source: main 0 passed, 1 failed each, with exactly 8 reference-image mismatches; head and integrated head 1 passed, 0 failed each, zero image mismatches. 0 ignored, 0 skipped throughout.

The fixture draws one full-screen triangle at z=0.5 into a 16x16 RGBA32F target with PC D24S8 depth, LESS testing, no depth writes, zero clamp/slope and a known constant color. The paired reference uses the same shaders and explicit PC bias, including the proposed x256 scale for format 118. CPU checks independently predict every pass/fail pixel with thresholds safely away from rounding boundaries.

  • 12 static cases: formats 118/45, bias -8/0/8, depth clear 0.5 +/- 1024 * 2^-24; the tested route calls pc_topology_type before PC PSO creation.
  • 20 dynamic cases: formats 118/45, bias -5/-0.5/0/0.4/1.5, clear 0.5 +/- 64 * 2^-24; real List9 calls go through the production list-state functions. Test-only registration supplies the original console-format base description to note_base for genuine PC PSOs.
  • Four switch cases: 118 to 45 through a non-dynamic 45 or compute PSO, and the reverse through non-dynamic 118 or compute. Final bias -0.5, clear 0.5 - 64 * 2^-24. Native-bias snapshots and final pixels both match the reference in the head.

For example, dynamic format 118 / bias -0.5 / negative clear threshold produces no colored pixels on main, with native bias -0.5. The head sends -128.0 and colors all 256 pixels, matching the explicit PC reference. Format 45 controls remain unchanged.

Across the nine raster processes: 324 paired cases, 648 D3D12 draw submissions, 663,552 readback u32 values, all independently checked. Captures are byte-identical within each source across repetitions; head/integrated-head captures and all sources' reference shader containers also match. Inherited XCL_* variables were cleared; XCL_NETWORK=0, XCL_REQUIRE_GPU=wave64, RX 9070 selected, and private enabled caches per process.

Not tested

The fixture uses a plain PC D3D12 device and test-only base registration, so it does not validate the complete console PSO/resource creation hooks. No GPU check of derived fallback PSOs, GS/mesh/pipeline-stream routes, nonzero clamp/slope, precision edges, native Windows, other GPUs, full suite, retail workload, scripts/smoke.ps1, performance or FPS. Original CPU tests cover their asserted stream/rounding/fallback-state cases only.

AI use

OpenAI Codex (GPT-6; exact serving variant not exposed) wrote the owned test-only fixture, ran the comparisons, independently verified the raw pixels/state and drafted this report. Publication authorized by the account owner.

<!-- greyfinch-sync:ivall/xcl:comment:7208356054 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7208356054). Originally posted by [SzczepanGrela](https://github.com/SzczepanGrela) on 2026-11-27T02:42:04Z. --- RX 9070 / RADV / Wine pixel-readback comparison at `25814cc2`: the head and its integration onto current main match the explicit PC depth-bias reference in all 36 synthetic raster cases. Main differs in 8 of 36 cases. All results repeat identically across three fresh processes per source. **Tested** - Exact head `25814cc264c041797ab8a542cdeed30416244a40`, main `8b957bec6f82495aec940944c6bf47faa02db590`, and a separate copy with the PR integrated onto that main. The three changed files on main match merge-base `e120925e3abc9956a8b9bae631969d32e8ccd43c`; the integrated files match the head. Local changes are test-only helpers/observations and the owned raster fixture. Original assertions are unchanged. - RX 9070 16 GB, RADV GFX1201, Mesa `26.3.1-arch3.5`; Ryzen 7 7700, CachyOS `7.3.0-5-cachyos`. Windows GNU release executables through GE-Proton11-12 / Wine 11.0 Staging, native D3D12 through vkd3d-proton `8293130ebe370b1+` (local asserts-disabled build). DXC/DXIL `1.9.2602.17`, Rust `1.97.1`. Adapter PCI `1002:7550` / LUID `00000000:000003ef` verified. OPTIONS16 dynamic depth bias and List9 are available. - Build each copy: `cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics`. - Original executable filters: `depth_bias stream_pipeline_defaults_depth_enable_from_dsv_format --nocapture --test-threads=1`, then `--test-threads=4`. Main: **5 passed, 0 failed** each; exact head and integrated head: **10 passed, 0 failed** each. The count difference is the PR's five new tests. The original native List9 test reports support and the same RX 9070 LUID. - Owned filter `workflow_d16_bias_raster --nocapture --test-threads=1`, three repetitions per source: main **0 passed, 1 failed** each, with exactly 8 reference-image mismatches; head and integrated head **1 passed, 0 failed** each, zero image mismatches. **0 ignored, 0 skipped** throughout. The fixture draws one full-screen triangle at `z=0.5` into a 16x16 RGBA32F target with PC D24S8 depth, LESS testing, no depth writes, zero clamp/slope and a known constant color. The paired reference uses the same shaders and explicit PC bias, including the proposed x256 scale for format 118. CPU checks independently predict every pass/fail pixel with thresholds safely away from rounding boundaries. - 12 static cases: formats 118/45, bias `-8/0/8`, depth clear `0.5 +/- 1024 * 2^-24`; the tested route calls `pc_topology_type` before PC PSO creation. - 20 dynamic cases: formats 118/45, bias `-5/-0.5/0/0.4/1.5`, clear `0.5 +/- 64 * 2^-24`; real List9 calls go through the production list-state functions. Test-only registration supplies the original console-format base description to `note_base` for genuine PC PSOs. - Four switch cases: 118 to 45 through a non-dynamic 45 or compute PSO, and the reverse through non-dynamic 118 or compute. Final bias `-0.5`, clear `0.5 - 64 * 2^-24`. Native-bias snapshots and final pixels both match the reference in the head. For example, dynamic format 118 / bias `-0.5` / negative clear threshold produces no colored pixels on main, with native bias `-0.5`. The head sends `-128.0` and colors all 256 pixels, matching the explicit PC reference. Format 45 controls remain unchanged. Across the nine raster processes: **324 paired cases, 648 D3D12 draw submissions, 663,552 readback u32 values**, all independently checked. Captures are byte-identical within each source across repetitions; head/integrated-head captures and all sources' reference shader containers also match. Inherited `XCL_*` variables were cleared; `XCL_NETWORK=0`, `XCL_REQUIRE_GPU=wave64`, RX 9070 selected, and private enabled caches per process. **Not tested** The fixture uses a plain PC D3D12 device and test-only base registration, so it does not validate the complete console PSO/resource creation hooks. No GPU check of derived fallback PSOs, GS/mesh/pipeline-stream routes, nonzero clamp/slope, precision edges, native Windows, other GPUs, full suite, retail workload, `scripts/smoke.ps1`, performance or FPS. Original CPU tests cover their asserted stream/rounding/fallback-state cases only. **AI use** OpenAI Codex (GPT-6; exact serving variant not exposed) wrote the owned test-only fixture, ran the comparisons, independently verified the raw pixels/state and drafted this report. Publication authorized by the account owner.
JJAutoCompare commented 2026-11-27 12:17:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T12:17:29Z.


Tested

Clean 25814cc264c041797ab8a542cdeed30416244a40 on Windows 11 build 26200.9974, Ryzen 7 3800X, Rust 1.100.0 MSVC, Intel Arc A770 driver 32.0.101.9175. Built the synthetic native D3D12 probe with cargo build --offline --manifest-path probe/Cargo.toml -j 2. Ran xcl-arc-depth-bias-probe.exe with XCL_ADAPTER=A770 under the shared Arc mutex. The probe used the exact-head XCL format and constant-bias helpers and confirmed the Arc backend.

  • Console D16S8 at requested bias −256 mapped to PC D24S8 at −65,536 and drew green.
  • Native D24S8 at requested bias −256 retained −256 and read back blue.
  • D16S8 at zero bias stayed blue. Native D24S8 at −65,536 drew green.

Four pixel readback assertions passed, zero failed, ignored, or skipped. Executable and wrapper hashes matched before, under, and after the lock.

Not tested

On-device dynamic bias, the separate D32_FLOAT fixture, full workspace suite and retail smoke.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the original verification, independently reproduced the cases reported here, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7218066654 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7218066654). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-27T12:17:29Z. --- **Tested** Clean `25814cc264c041797ab8a542cdeed30416244a40` on Windows 11 build 26200.9974, Ryzen 7 3800X, Rust 1.100.0 MSVC, Intel Arc A770 driver 32.0.101.9175. Built the synthetic native D3D12 probe with `cargo build --offline --manifest-path probe/Cargo.toml -j 2`. Ran `xcl-arc-depth-bias-probe.exe` with `XCL_ADAPTER=A770` under the shared Arc mutex. The probe used the exact-head XCL format and constant-bias helpers and confirmed the Arc backend. - Console D16S8 at requested bias −256 mapped to PC D24S8 at −65,536 and drew green. - Native D24S8 at requested bias −256 retained −256 and read back blue. - D16S8 at zero bias stayed blue. Native D24S8 at −65,536 drew green. Four pixel readback assertions passed, zero failed, ignored, or skipped. Executable and wrapper hashes matched before, under, and after the lock. **Not tested** On-device dynamic bias, the separate D32_FLOAT fixture, full workspace suite and retail smoke. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the original verification, independently reproduced the cases reported here, and wrote this report.
throny commented 2026-11-27 23:13:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:13:17Z.


merge-check claim
head: 25814cc264

<!-- greyfinch-sync:ivall/xcl:comment:7229968940 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7229968940). Originally posted by [throny](https://github.com/throny) on 2026-11-27T23:13:17Z. --- merge-check claim head: 25814cc264c041797ab8a542cdeed30416244a40
throny commented 2026-11-27 23:27:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:27:23Z.


merge-check
base: 2c717a04
head: 25814cc264
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1471 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines)
review: none blocking. The arithmetic is right: one bias unit on a UNORM depth buffer is 2^-n, so a 16-bit bias becomes 256 times as many 24-bit units; clamp and slope bias are unchanged, the multiply saturates, and the float path is clamped before rounding. Double scaling is avoided because the format is rewritten when the bias is scaled, so a second pass sees the 24-bit format; the blob key is hashed after that, so no stale driver blob is reused. Minor: a rectangle-list stream with a fractional bias in the newer rasterizer subobjects skips the float fix, so the fraction is truncated before scaling. Both earlier review findings are fixed on this head.
performance: default path, limited to pipelines whose console depth format is the 16-bit one and whose bias is non-zero (static pipelines, all stream paths, and the dynamic bias call); other formats are untouched. A title that looked right before with such a bias was getting 1/256 of the intended offset, so its picture can change: worth a look on a title that uses that format (not checked here). One more table lookup per pipeline bind; affected pipelines are rebuilt once by the driver.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7230154697 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7230154697). Originally posted by [throny](https://github.com/throny) on 2026-11-27T23:27:23Z. --- merge-check base: 2c717a04 head: 25814cc264c041797ab8a542cdeed30416244a40 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1471 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines) review: none blocking. The arithmetic is right: one bias unit on a UNORM depth buffer is 2^-n, so a 16-bit bias becomes 256 times as many 24-bit units; clamp and slope bias are unchanged, the multiply saturates, and the float path is clamped before rounding. Double scaling is avoided because the format is rewritten when the bias is scaled, so a second pass sees the 24-bit format; the blob key is hashed after that, so no stale driver blob is reused. Minor: a rectangle-list stream with a fractional bias in the newer rasterizer subobjects skips the float fix, so the fraction is truncated before scaling. Both earlier review findings are fixed on this head. performance: default path, limited to pipelines whose console depth format is the 16-bit one and whose bias is non-zero (static pipelines, all stream paths, and the dynamic bias call); other formats are untouched. A title that looked right before with such a bias was getting 1/256 of the intended offset, so its picture can change: worth a look on a title that uses that format (not checked here). One more table lookup per pipeline bind; affected pipelines are rebuilt once by the driver. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
KOLESNiii commented 2026-11-28 03:53:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T03:53:15Z.


merge-check claim
head: 25814cc264

<!-- greyfinch-sync:ivall/xcl:comment:7233479540 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7233479540). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T03:53:15Z. --- merge-check claim head: 25814cc264c041797ab8a542cdeed30416244a40
KOLESNiii commented 2026-11-28 04:27:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T04:27:11Z.


merge-check
base: e429936c10
head: 25814cc264
merge: clean
build: cargo build --workspace -> ok; the test build (cargo test --workspace --no-run) -> failed: error[E0023] this pattern has 1 field, but the corresponding tuple variant has 2 fields (crates/xcl/src/hle/d3d12x/real.rs:11552, the new map_tests case matches StreamPipeline::Graphics(g); on main the variant is Graphics(Box<D3D12_GRAPHICS_PIPELINE_STATE_DESC>, bool))
tests: not run (the test build fails)
review: none in the runtime code. Whole diff read (device_x.rs pc_depth_bias / DepthBias::for_dsv, list_x.rs native bias in the bound pipeline's depth units, real.rs stream / GS / fallback / pc_topology_type / stream_pipeline). A console D16_UNORM_S8_UINT pipeline (D24_UNORM_S8_UINT on the PC) gets its constant depth bias times 256; slope-scaled bias and the clamp stay; each path scales once. Only the new test's pattern needs the second field (StreamPipeline::Graphics(g, _)).
performance: reasoned, not measured: a map lookup of the bound pipeline's format per native depth-bias update
verdict: not yet: the test build fails on the merge (a new test's StreamPipeline::Graphics pattern needs main's second field)
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 09b54011dbd38b15826bb81a1108839802e6c624 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).

<!-- greyfinch-sync:ivall/xcl:comment:7234048277 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7234048277). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T04:27:11Z. --- merge-check base: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd head: 25814cc264c041797ab8a542cdeed30416244a40 merge: clean build: cargo build --workspace -> ok; the test build (cargo test --workspace --no-run) -> failed: error[E0023] this pattern has 1 field, but the corresponding tuple variant has 2 fields (crates/xcl/src/hle/d3d12x/real.rs:11552, the new map_tests case matches StreamPipeline::Graphics(g); on main the variant is Graphics(Box<D3D12_GRAPHICS_PIPELINE_STATE_DESC>, bool)) tests: not run (the test build fails) review: none in the runtime code. Whole diff read (device_x.rs pc_depth_bias / DepthBias::for_dsv, list_x.rs native bias in the bound pipeline's depth units, real.rs stream / GS / fallback / pc_topology_type / stream_pipeline). A console D16_UNORM_S8_UINT pipeline (D24_UNORM_S8_UINT on the PC) gets its constant depth bias times 256; slope-scaled bias and the clamp stay; each path scales once. Only the new test's pattern needs the second field (StreamPipeline::Graphics(g, _)). performance: reasoned, not measured: a map lookup of the bound pipeline's format per native depth-bias update verdict: not yet: the test build fails on the merge (a new test's StreamPipeline::Graphics pattern needs main's second field) hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 09b54011dbd38b15826bb81a1108839802e6c624 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
tiagonleal commented 2026-11-28 14:37:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-28T14:37:06Z.


@KOLESNiii thanks for the merge check. The head is now b1db118d, rebased onto main e429936c, and the test pattern has main's second field. The rebase needed two more changes, because main added a native route for streams with extended rasterizer state and gave RASTERIZER_DESC2 its own arm; both are in the description with the tests that fail without them. Suite and smoke blocks there are from the new head.

AI use: Claude Code wrote this comment (Claude Fable 5.2).

<!-- greyfinch-sync:ivall/xcl:comment:7240803896 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7240803896). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-28T14:37:06Z. --- @KOLESNiii thanks for the merge check. The head is now `b1db118d`, rebased onto `main` `e429936c`, and the test pattern has `main`'s second field. The rebase needed two more changes, because `main` added a native route for streams with extended rasterizer state and gave RASTERIZER_DESC2 its own arm; both are in the description with the tests that fail without them. Suite and smoke blocks there are from the new head. **AI use:** Claude Code wrote this comment (Claude Fable 5.2).
throny commented 2026-11-28 17:47:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T17:47:44Z.


merge-check claim
head: c4dc6e626b

Re-check of the new head (my earlier check was on the head before the rebase).

<!-- greyfinch-sync:ivall/xcl:comment:7243292575 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7243292575). Originally posted by [throny](https://github.com/throny) on 2026-11-28T17:47:44Z. --- merge-check claim head: c4dc6e626b40a19a146d90ec740e4415e9b63ebf Re-check of the new head (my earlier check was on the head before the rebase).
throny commented 2026-11-28 18:04:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T18:04:01Z.


merge-check
base: 10d27297
head: c4dc6e626b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2158 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at 10d27297: 2152 passed, 0 failed, 48 ignored.
review: re-check of the new head. It answers the "not yet" in the thread (the test did not build on main: its pattern now matches main's variant). Beyond the rebase: the extended-rasterizer arm sets the float bias too, and main's native route for such streams now scales the bias as well, with its own test; that route rewrites the 16-bit format to the PC view format, so a second pass does not scale twice. Not looked at again: whether the native-preparation key needs a bump (my earlier check found the blob key is hashed after scaling). Minor, as before: a fractional bias is truncated for rect lists.
performance: none. No translator source.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7243502941 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7243502941). Originally posted by [throny](https://github.com/throny) on 2026-11-28T18:04:01Z. --- merge-check base: 10d27297 head: c4dc6e626b40a19a146d90ec740e4415e9b63ebf merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2158 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at 10d27297: 2152 passed, 0 failed, 48 ignored. review: re-check of the new head. It answers the "not yet" in the thread (the test did not build on main: its pattern now matches main's variant). Beyond the rebase: the extended-rasterizer arm sets the float bias too, and main's native route for such streams now scales the bias as well, with its own test; that route rewrites the 16-bit format to the PC view format, so a second pass does not scale twice. Not looked at again: whether the native-preparation key needs a bump (my earlier check found the blob key is hashed after scaling). Minor, as before: a fractional bias is truncated for rect lists. performance: none. No translator source. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
KDenKC commented 2026-11-29 20:30:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T20:30:38Z.


A heads-up from carrying this PR in an integration build with #3223 (Kalmarv's RSSetDepthBiasX x64 ABI fix): both merge clean on main, but together this PR's two new tests in list_x.rs don't compile, because #3223 changes set_depth_bias_x to the console's signature (an integer depth bias plus DepthClipEnable, 5 arguments) and the tests call the float form with 4. Whichever of the two merges second only needs those two calls updated: we used integer overrides with depth clip on (-0.5 becomes -2, so the D16S8 case still shows the x256 scaling: -512 / -2 / -512; -1.0 becomes -1, expectations unchanged). No runtime change needed. (Found by the build of the combined tree on an RTX 3090, driver 621.24. With the two calls adapted as above: native_depth_bias_follows_the_bound_pipelines_depth_format ok, native_depth_bias_resends_after_a_pipeline_that_does_not_sync ok; cargo test -p xcl --lib -- depth_bias --test-threads=1: 10 passed, 0 failed, 0 ignored, nothing skipped.)

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7262137018 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7262137018). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-29T20:30:38Z. --- A heads-up from carrying this PR in an integration build with #3223 (Kalmarv's `RSSetDepthBiasX` x64 ABI fix): both merge clean on `main`, but together this PR's two new tests in `list_x.rs` don't compile, because #3223 changes `set_depth_bias_x` to the console's signature (an integer depth bias plus `DepthClipEnable`, 5 arguments) and the tests call the float form with 4. Whichever of the two merges second only needs those two calls updated: we used integer overrides with depth clip on (`-0.5` becomes `-2`, so the D16S8 case still shows the x256 scaling: -512 / -2 / -512; `-1.0` becomes `-1`, expectations unchanged). No runtime change needed. (Found by the build of the combined tree on an RTX 3090, driver 621.24. With the two calls adapted as above: `native_depth_bias_follows_the_bound_pipelines_depth_format` ok, `native_depth_bias_resends_after_a_pipeline_that_does_not_sync` ok; `cargo test -p xcl --lib -- depth_bias --test-threads=1`: 10 passed, 0 failed, 0 ignored, nothing skipped.) AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.
Foniass commented 2026-12-01 09:04:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:04:19Z.


Triage (#1607) – head c3467c1

No open or merged PR scales the depth bias for console D16_UNORM_S8_UINT (118) mapped to D24S8. Main has no pc_depth_bias, and the other open depth-bias PRs (#1331, #3223, #927) change other things.
The patched-PSO path writes the PC DSV format back into the desc before dev_create_graphics_pso, so pc_topology_type does not scale the bias twice. native_bias now stores the scaled value at every site that called try_native_depth_bias. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7306172814 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7306172814). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:04:19Z. --- **Triage (#1607)** – head c3467c1 No open or merged PR scales the depth bias for console D16_UNORM_S8_UINT (118) mapped to D24S8. Main has no `pc_depth_bias`, and the other open depth-bias PRs (#1331, #3223, #927) change other things. The patched-PSO path writes the PC DSV format back into the desc before `dev_create_graphics_pso`, so `pc_topology_type` does not scale the bias twice. `native_bias` now stores the scaled value at every site that called `try_native_depth_bias`. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
fromthemoonx commented 2026-12-03 05:57:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T05:57:14Z.


merge-check
base: 16c2fd082a
head: c3467c18e0
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3018 passed, 0 failed, 56 ignored (base: 3012 passed, 0 failed, 56 ignored, counted on 395405e4; only docs and scripts changed since); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none
review: read the whole diff (3 files, +355 -48). No finding in this PR.

  1. The depth that is drawn is right. I drew a triangle at depth 0.25 and read the depth plane back on the RTX 3060 (scratch test, 3 of 3 runs the same). Offset from the same draw with no bias, in units of 2^-16:
depth buffer bias main this PR
D16S8 (118, D24S8 on the PC) pipeline, 4 0.016 4.000
D16S8 pipeline, -8 -0.031 -8.000
D16S8 RSSetDepthBiasX, 4 0.016 4.000
D16S8 RSSetDepthBiasX, 1.5 0.004 1.500
D16 (55), for comparison 4 / -8 4.000 / -8.000 same
D24S8 (45) 4 / -8 0.016 / -0.031 same

The PR gives the same numbers with dynamic depth bias switched off (the patched-pipeline fallback), so nothing is scaled twice there. The test used a PC vertex shader and made the pipeline from pc_topology_type's description, so the shader translation was not part of it. The GS and mesh stream paths were only read.
2) Every caller of try_native_depth_bias sets the list's bound_pso first, so the bias is scaled for the right pipeline. A switch between a D24S8 and a D16S8 pipeline sends it again.
3) The compile conflict with #3223 (comment above) is gone: #3223 was closed without merging.
4) Tests at 8 threads: depth_bias no failure in 30 runs, device_x none in 15. list_x failed 1 of 15 runs, and 4 of 15 on base. The failing tests are not about depth bias.
5) Not caused by this PR, main does it too: with dynamic bias, a bias set by RSSetDepthBiasX is lost when the next pipeline is bound with the same bias still set. Issue: #3771.
6) Not tested: a retail title (none on this machine), AMD.
performance: one more lookup in BASES for each dynamic bias and for each bind of a pipeline with dynamic bias. Reasoned, not measured.
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7369292652 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2858#issuecomment-7369292652). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-03T05:57:14Z. --- merge-check base: 16c2fd082ae2e96967a2ab553bc2e1032e491f70 head: c3467c18e0cccebd224e0ee3c260d3fa3bead52f merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3018 passed, 0 failed, 56 ignored (base: 3012 passed, 0 failed, 56 ignored, counted on 395405e4; only docs and scripts changed since); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none review: read the whole diff (3 files, +355 -48). No finding in this PR. 1) The depth that is drawn is right. I drew a triangle at depth 0.25 and read the depth plane back on the RTX 3060 (scratch test, 3 of 3 runs the same). Offset from the same draw with no bias, in units of 2^-16: | depth buffer | bias | main | this PR | |---|---|---|---| | D16S8 (118, D24S8 on the PC) | pipeline, 4 | 0.016 | **4.000** | | D16S8 | pipeline, -8 | -0.031 | **-8.000** | | D16S8 | `RSSetDepthBiasX`, 4 | 0.016 | **4.000** | | D16S8 | `RSSetDepthBiasX`, 1.5 | 0.004 | **1.500** | | D16 (55), for comparison | 4 / -8 | 4.000 / -8.000 | same | | D24S8 (45) | 4 / -8 | 0.016 / -0.031 | same | The PR gives the same numbers with dynamic depth bias switched off (the patched-pipeline fallback), so nothing is scaled twice there. The test used a PC vertex shader and made the pipeline from `pc_topology_type`'s description, so the shader translation was not part of it. The GS and mesh stream paths were only read. 2) Every caller of `try_native_depth_bias` sets the list's `bound_pso` first, so the bias is scaled for the right pipeline. A switch between a D24S8 and a D16S8 pipeline sends it again. 3) The compile conflict with #3223 (comment above) is gone: #3223 was closed without merging. 4) Tests at 8 threads: `depth_bias` no failure in 30 runs, `device_x` none in 15. `list_x` failed 1 of 15 runs, and 4 of 15 on base. The failing tests are not about depth bias. 5) Not caused by this PR, main does it too: with dynamic bias, a bias set by `RSSetDepthBiasX` is lost when the next pipeline is bound with the same bias still set. Issue: #3771. 6) Not tested: a retail title (none on this machine), AMD. performance: one more lookup in `BASES` for each dynamic bias and for each bind of a pipeline with dynamic bias. Reasoned, not measured. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2858:upstream-pr/2858'
git switch 'upstream-pr/2858'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2858'
git switch 'upstream-pr/2858'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2858'
git switch 'upstream-pr/2858'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2858'
git switch 'main'
git merge --squash 'upstream-pr/2858'
git switch 'main'
git merge --ff-only 'upstream-pr/2858'
git switch 'main'
git merge 'upstream-pr/2858'
git push origin 'main'
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
xcl-dev/xcl!2858
No description provided.