runtime: composite the presented planes in the output window #2639

Merged
pigalot merged 3 commits from upstream-pr/2647 into main 2026-11-26 01:45:54 +00:00
pigalot commented 2026-11-26 00:26:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-26T00:26:24Z.


Change

Slice 1 of 4 from #2591, the compositor. It runs under any profile.

A console present (CommandQueue slot 32) can carry several plane records
(present_planes.h: 0x48 bytes each, +0x08 resource count, +0x10 resource array). The output window
showed plane 0 alone. On a two-plane present I measured, plane 0 (1920x1080) stayed black and plane 1
(3840x2160) held the picture with alpha 255, so the window was black.

The window now composites the planes. The draw (shaders, root signature, opaque and blend pipelines,
per-plane SRVs and draws) moves out of d3d12_present.inl into src/startup_stubs/plane_compositor.h.
The window presenter and the new WARP fixture use the same PlaneCompositor, so the fixture runs the
same draw code as the window, not a copy of it.

Supported alpha and order contract (also in docs/startup-runtime.md#presented-planes):

  • Order: plane 0 first, then each later plane over it, in plane order (composite_steps). At most
    four planes are read.
  • Bottom plane: the lowest drawn plane is opaque. Its colour replaces the target and its alpha is
    ignored.
  • Later planes: blended by their own straight (not premultiplied) alpha:
    rgb = src.rgb * a + dst.rgb * (1 - a) (SRC_ALPHA / INV_SRC_ALPHA; alpha ONE /
    INV_SRC_ALPHA). Alpha 0 keeps what is below, alpha 255 replaces it, and the target alpha stays 255.
  • Left out: an unreadable or empty record, a surface that is not a known resource or cannot be
    drawn (present_view_format.h), and a repeat of a surface already drawn. If plane 0 is left out,
    the next drawn plane becomes the opaque base.
  • Not decoded: the source and destination rectangles in the record. Each plane is scaled to the
    whole window.

X2W_PRESENT_PLANE=<n> (diagnostic) shows plane n alone. The first presents log each plane's shape.
The x2w-render presented readback now reports the topmost drawn plane and adds a mean alpha. This
answers the review report of a top plane with alpha about 5/255 on hardware: that plane now
contributes about 5/255 of its colour over the plane below it. It no longer replaces it.

Refs #2591. Independent of the other three slices (slot 76, view dimensions, console profile).

Verification

Build: this branch, one commit cb137898 on main at 02368737. From the worktree in PowerShell:
. .\tools\dev.ps1, cmake --preset release, cmake --build --preset release (Python env
out/pe-env from requirements-dev.txt).

Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088, Windows 10.0.26200.9974. The new fixtures
use in-box WARP, with the debug layer off.

  • ctest --preset release --no-tests=error -R '^startup_present_(planes|composite_warp)(_control)?$' -V:
    4/4 passed. startup_present_planes and startup_present_composite_warp print ok. Both controls
    print FAIL: lines, as their regex requires.
  • ctest --preset release -j 8 --no-tests=error -R '^startup_' -E '_hardware$|^startup_audio_': 642
    tests, 635 passed, 6 skipped (capability, exit 77), 1 failed. The failure was startup_inflate,
    which timed out at 60 s under -j 8. Rerun alone with
    ctest --preset release --no-tests=error -R '^startup_inflate$' it passed in 9.1 s. This change
    does not touch it. (Run before a final amend that only moved an #include / CMake block to avoid a merge conflict with the sibling slices; the slice's own tests were rerun after it and pass.)
  • python -B tests/docs_links_check.py: pass (19 Markdown files, 508 links).
    python -B tests/bidi_controls_check.py: pass (no bidirectional controls).
    git diff --check origin/main...HEAD: clean.

Evidence

startup_present_composite_warp builds 64x32 RGBA8 planes from source (cells of 16x16 texels). It
passes them through synthetic 0x48-byte plane records, then present_plane_resource, then
composite_steps, then PlaneCompositor::record into a render target cleared to
(64,128,191,0). It reads every texel back. Observed on WARP:

Case Planes Read back (every texel of each cell)
single-plane baseline one plane of eight colours, one cell alpha 0 and one alpha 128 each cell exactly its colour, alpha 255
stacked black opaque plane 0; plane 1 cells with alpha 0 / 128 / 5 / 255; plane 2 with half red over plane 1's opaque blue, opaque yellow, opaque cyan, alpha 0 0,0,0 / 0,128,0 / 5,5,5 / 0,0,255; 128,0,127 / 255,255,0 / 0,255,255 / 0,0,0; alpha 255 everywhere
skipped black, plane 1, plane 1's surface again, a record with no resource two steps; the same picture as black + plane 1 (a drawn repeat would give 0,191,0 and 10,10,10)

Opaque cells are exact. Blended cells are within 1 level of the expected value. 128,0,127 depends on
plane order: plane 1 under plane 2. --control composites only the black first plane. The baseline
still passes, and every overlay cell plus both step counts print FAIL:. The test exits 77 when no
WARP adapter is available.

startup_present_planes (from #2591, unchanged) checks the record layout and the composite order on
synthetic records. Its control reads 0x40-byte records and composites plane 0 alone.

All inputs are written in source (MIT). Why plane 0 stays black on the console path is still unknown,
and the record's rectangles are not decoded. A start-up run with a local console executable (not
included) showed a picture with this change. That run is recorded in #2591, not repeated here.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

This change was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6616646529 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2647). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-26T00:26:24Z. --- ## Change Slice 1 of 4 from #2591, the compositor. It runs under any profile. A console present (CommandQueue slot 32) can carry several plane records (`present_planes.h`: 0x48 bytes each, +0x08 resource count, +0x10 resource array). The output window showed plane 0 alone. On a two-plane present I measured, plane 0 (1920x1080) stayed black and plane 1 (3840x2160) held the picture with alpha 255, so the window was black. The window now composites the planes. The draw (shaders, root signature, opaque and blend pipelines, per-plane SRVs and draws) moves out of `d3d12_present.inl` into `src/startup_stubs/plane_compositor.h`. The window presenter and the new WARP fixture use the same `PlaneCompositor`, so the fixture runs the same draw code as the window, not a copy of it. Supported alpha and order contract (also in `docs/startup-runtime.md#presented-planes`): - **Order:** plane 0 first, then each later plane over it, in plane order (`composite_steps`). At most four planes are read. - **Bottom plane:** the lowest drawn plane is opaque. Its colour replaces the target and its alpha is ignored. - **Later planes:** blended by their own straight (not premultiplied) alpha: `rgb = src.rgb * a + dst.rgb * (1 - a)` (`SRC_ALPHA` / `INV_SRC_ALPHA`; alpha `ONE` / `INV_SRC_ALPHA`). Alpha 0 keeps what is below, alpha 255 replaces it, and the target alpha stays 255. - **Left out:** an unreadable or empty record, a surface that is not a known resource or cannot be drawn (`present_view_format.h`), and a repeat of a surface already drawn. If plane 0 is left out, the next drawn plane becomes the opaque base. - **Not decoded:** the source and destination rectangles in the record. Each plane is scaled to the whole window. `X2W_PRESENT_PLANE=<n>` (diagnostic) shows plane `n` alone. The first presents log each plane's shape. The `x2w-render presented` readback now reports the topmost drawn plane and adds a mean alpha. This answers the review report of a top plane with alpha about 5/255 on hardware: that plane now contributes about 5/255 of its colour over the plane below it. It no longer replaces it. Refs #2591. Independent of the other three slices (slot 76, view dimensions, console profile). ## Verification Build: this branch, one commit `cb137898` on `main` at `02368737`. From the worktree in PowerShell: `. .\tools\dev.ps1`, `cmake --preset release`, `cmake --build --preset release` (Python env `out/pe-env` from `requirements-dev.txt`). Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088, Windows 10.0.26200.9974. The new fixtures use in-box WARP, with the debug layer off. - `ctest --preset release --no-tests=error -R '^startup_present_(planes|composite_warp)(_control)?$' -V`: 4/4 passed. `startup_present_planes` and `startup_present_composite_warp` print `ok`. Both controls print `FAIL:` lines, as their regex requires. - `ctest --preset release -j 8 --no-tests=error -R '^startup_' -E '_hardware$|^startup_audio_'`: 642 tests, 635 passed, 6 skipped (capability, exit 77), 1 failed. The failure was `startup_inflate`, which timed out at 60 s under `-j 8`. Rerun alone with `ctest --preset release --no-tests=error -R '^startup_inflate$'` it passed in 9.1 s. This change does not touch it. (Run before a final amend that only moved an `#include` / CMake block to avoid a merge conflict with the sibling slices; the slice's own tests were rerun after it and pass.) - `python -B tests/docs_links_check.py`: pass (19 Markdown files, 508 links). `python -B tests/bidi_controls_check.py`: pass (no bidirectional controls). `git diff --check origin/main...HEAD`: clean. ## Evidence `startup_present_composite_warp` builds 64x32 RGBA8 planes from source (cells of 16x16 texels). It passes them through synthetic 0x48-byte plane records, then `present_plane_resource`, then `composite_steps`, then `PlaneCompositor::record` into a render target cleared to (64,128,191,0). It reads every texel back. Observed on WARP: | Case | Planes | Read back (every texel of each cell) | |---|---|---| | single-plane baseline | one plane of eight colours, one cell alpha 0 and one alpha 128 | each cell exactly its colour, alpha 255 | | stacked | black opaque plane 0; plane 1 cells with alpha 0 / 128 / 5 / 255; plane 2 with half red over plane 1's opaque blue, opaque yellow, opaque cyan, alpha 0 | 0,0,0 / 0,128,0 / 5,5,5 / 0,0,255; 128,0,127 / 255,255,0 / 0,255,255 / 0,0,0; alpha 255 everywhere | | skipped | black, plane 1, plane 1's surface again, a record with no resource | two steps; the same picture as black + plane 1 (a drawn repeat would give 0,191,0 and 10,10,10) | Opaque cells are exact. Blended cells are within 1 level of the expected value. `128,0,127` depends on plane order: plane 1 under plane 2. `--control` composites only the black first plane. The baseline still passes, and every overlay cell plus both step counts print `FAIL:`. The test exits 77 when no WARP adapter is available. `startup_present_planes` (from #2591, unchanged) checks the record layout and the composite order on synthetic records. Its control reads 0x40-byte records and composites plane 0 alone. All inputs are written in source (MIT). Why plane 0 stays black on the console path is still unknown, and the record's rectangles are not decoded. A start-up run with a local console executable (not included) showed a picture with this change. That run is recorded in #2591, not repeated here. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. This change was AI-assisted.
tedin7 commented 2026-11-26 01:02:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:31:47Z.

Review: COMMENTED


Comment review of head cb137898 (code and fixture tests only).

What I checked:

  • present_planes.h: composite_steps keeps plane order, drops unreadable planes and repeats of a surface already drawn, and makes the lowest drawn plane the opaque base. Matches the contract in the PR body and in docs/startup-runtime.md.
  • plane_compositor.h: the opaque pipeline writes float4(rgb, 1). The blend pipeline uses SRC_ALPHA / INV_SRC_ALPHA for colour and ONE / INV_SRC_ALPHA for alpha, so straight alpha over an opaque base keeps target alpha at 255. Window presenter and the WARP fixture share this class, so the fixture exercises the window's draw code.
  • d3d12_xs_device.cpp: presented_planes() bounds the loop by window_planes, falls back to the first known surface when none can be drawn, and X2W_PRESENT_PLANE still selects one plane.
  • The new WARP fixture compares GPU readback with CPU-computed expected colours for the baseline, stacked and skipped cases, not string checks.
  • No other open or merged PR covers this slice (search "composite planes present": only #2591, the series issue-PR this one is slice 1 of).

Commands run (Linux, in a worktree of this head):

  • git diff --check origin/main...HEAD: clean.
  • python3 tests/docs_links_check.py: passed (19 files, 508 links).
  • python3 tests/bidi_controls_check.py: passed.
  • g++ -std=c++17 tests/startup_present_planes_check.cpp (pure logic, builds on Linux): ok.
  • Mutation 1: first drawn plane no longer marked opaque/blended correctly (PlaneStep{i, false}): startup_present_planes: FAIL, "plane 1 is drawn over plane 0, blended".
  • Mutation 2: repeat-surface check removed: FAIL, "a surface presented twice is drawn once".
  • The D3D12 WARP fixture (startup_present_composite_warp) needs Windows; I did not run it here.

Findings: no bugs found in the code. The branch is 20 commits behind main.

Why this is not merged by me: the PR describes a measured black window on a real two-plane present (blocker seen while running the console executable), and its fix is meant to advance that run. We have no access to the executable, so the fixture results above are the only thing verified. Whether the window now shows the picture, and the hardware report of a top plane with alpha about 5/255, must be confirmed by whoever merges, on the executable. The merge stays with MasterDomino or @R0Y00.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6066933781 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2647#pullrequestreview-6066933781). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:31:47Z. **Review:** COMMENTED --- Comment review of head cb137898 (code and fixture tests only). What I checked: - `present_planes.h`: `composite_steps` keeps plane order, drops unreadable planes and repeats of a surface already drawn, and makes the lowest drawn plane the opaque base. Matches the contract in the PR body and in `docs/startup-runtime.md`. - `plane_compositor.h`: the opaque pipeline writes `float4(rgb, 1)`. The blend pipeline uses `SRC_ALPHA / INV_SRC_ALPHA` for colour and `ONE / INV_SRC_ALPHA` for alpha, so straight alpha over an opaque base keeps target alpha at 255. Window presenter and the WARP fixture share this class, so the fixture exercises the window's draw code. - `d3d12_xs_device.cpp`: `presented_planes()` bounds the loop by `window_planes`, falls back to the first known surface when none can be drawn, and `X2W_PRESENT_PLANE` still selects one plane. - The new WARP fixture compares GPU readback with CPU-computed expected colours for the baseline, stacked and skipped cases, not string checks. - No other open or merged PR covers this slice (search "composite planes present": only #2591, the series issue-PR this one is slice 1 of). Commands run (Linux, in a worktree of this head): - `git diff --check origin/main...HEAD`: clean. - `python3 tests/docs_links_check.py`: passed (19 files, 508 links). - `python3 tests/bidi_controls_check.py`: passed. - `g++ -std=c++17 tests/startup_present_planes_check.cpp` (pure logic, builds on Linux): `ok`. - Mutation 1: first drawn plane no longer marked opaque/blended correctly (`PlaneStep{i, false}`): `startup_present_planes: FAIL`, "plane 1 is drawn over plane 0, blended". - Mutation 2: repeat-surface check removed: FAIL, "a surface presented twice is drawn once". - The D3D12 WARP fixture (`startup_present_composite_warp`) needs Windows; I did not run it here. Findings: no bugs found in the code. The branch is 20 commits behind main. Why this is not merged by me: the PR describes a measured black window on a real two-plane present (blocker seen while running the console executable), and its fix is meant to advance that run. We have no access to the executable, so the fixture results above are the only thing verified. Whether the window now shows the picture, and the hardware report of a top plane with alpha about 5/255, must be confirmed by whoever merges, on the executable. The merge stays with MasterDomino or @R0Y00. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 01:02:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T00:44:06Z.

Review: CHANGES_REQUESTED


Windows Release at cb137898 reproduced the WARP composite and the expected overlay pixel differences. Two things remain for this slice. The PASS_REGULAR_EXPRESSION "FAIL: " accepts queue or compositor setup failure and device removal as a successful negative control. Make the control succeed only after the baseline matches, a fence completes, and removing the overlay produces the expected pixel differences. Also keep the new multi-plane presentation behind an explicit experimental option until there is a matched executable comparison of this standalone candidate. The #2591 run combined four changes. Preserve the existing baseline capture and label the highest-plane sample as a raw plane so it cannot be mistaken for final composited pixels.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6067018928 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2647#pullrequestreview-6067018928). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T00:44:06Z. **Review:** CHANGES_REQUESTED --- Windows Release at `cb137898` reproduced the WARP composite and the expected overlay pixel differences. Two things remain for this slice. The `PASS_REGULAR_EXPRESSION "FAIL: "` accepts queue or compositor setup failure and device removal as a successful negative control. Make the control succeed only after the baseline matches, a fence completes, and removing the overlay produces the expected pixel differences. Also keep the new multi-plane presentation behind an explicit experimental option until there is a matched executable comparison of this standalone candidate. The #2591 run combined four changes. Preserve the existing baseline capture and label the highest-plane sample as a raw plane so it cannot be mistaken for final composited pixels.
upstream-sync closed this pull request 2026-11-26 02:04:54 +00:00
R0Y00 commented 2026-11-26 02:04:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T01:45:36Z.

Review: APPROVED


Windows Release builds the production shim and passes all four presenter CTests at ac59fc3e. The default setup uses one descriptor and only the opaque pipeline. The same fixture then configures the opt-in compositor and checks stacked and skipped planes. The overlay-removed control completed all eight fences and found exactly six changed cells out of eight. This addresses the two review findings. A matched real-executable comparison remains separate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6067445577 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2647#pullrequestreview-6067445577). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T01:45:36Z. **Review:** APPROVED --- Windows Release builds the production shim and passes all four presenter CTests at ac59fc3e. The default setup uses one descriptor and only the opaque pipeline. The same fixture then configures the opt-in compositor and checks stacked and skipped planes. The overlay-removed control completed all eight fences and found exactly six changed cells out of eight. This addresses the two review findings. A matched real-executable comparison remains separate.
pigalot commented 2026-11-26 02:05:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-26T01:05:31Z.


Thanks for reproducing it at cb137898. Both points are addressed in fddd5f70 (a new commit on top; nothing rebased).

1. The negative control now passes only on success

  • It is renamed startup_present_composite_overlay_removed_control_warp, to follow the other _control_warp tests. It runs the same baseline, stacked and skipped cases as startup_present_composite_warp. Then it removes the overlays and composites the black plane 0 alone.
  • It prints control ok: baseline matched, <n> fences completed, removing the overlay changed 6 of 8 cells as expected and exits 0 only when all of these hold:
    • the baseline and stacked cases matched;
    • every fence completed (Gpu::run now fails on a close or signal error, a wait that does not reach the value, or a completed value of UINT64_MAX), and GetDeviceRemovedReason reports no removal;
    • the overlay-free picture is black and differs from the stacked expectation in exactly the six cells the overlays draw. The other two cells must still match.
  • Registration: PASS_REGULAR_EXPRESSION "control ok: baseline matched", FAIL_REGULAR_EXPRESSION "FAIL: ", SKIP_RETURN_CODE 77 (no WARP). Every failure path prints FAIL:, including queue, compositor, target and plane setup.

2. Multi-plane presentation is now experimental and opt-in

  • By default the window shows plane 0 alone, as on main. Plane 0 is the only plane drawn, through the same opaque full-window draw with a linear, clamped sampler. No swap chain is created when plane 0 cannot be drawn.
  • The composite runs only with X2W_PRESENT_COMPOSITE=1. It stays opt-in until there is a matched comparison on the same executable with this change alone. X2W_PRESENT_PLANE=<n> still shows plane n alone, with or without the switch.
  • The baseline capture is restored, with or without the switch. The frame capture, the presented signature, X2W_D3D12_DUMP_SURFACE and the x2w-render presented readback all read plane 0's first resource again. The x2w-render presented line is back to its main format (I dropped the mean-alpha field).
  • Under the switch, the highest plane above plane 0 is sampled separately on the same frames and logged as x2w-render raw plane <i> (not composited): surface ..., sample <k>, mean level ..., mean alpha .... It does not touch the window copy, the note or the dump.
  • The x2w-present frame <n> plane <i>/<count> shape lines (first presents and every 300th) are still logged in both modes. They only log.
  • docs/startup-runtime.md#presented-planes and the switch table describe the default, the opt-in and the raw plane line. The fixture still tests the compositor directly, without the switch.

Results

Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088, Windows 10.0.26200, Release preset, debug layer off (the composite fixture does not enable it). Commit fddd5f70.

. .\tools\dev.ps1
cmake --preset release
cmake --build --preset release
ctest --preset release --no-tests=error -R 'present' -V

14/14 passed, 0 failed, 0 skipped. Among them:

  • startup_present_composite_warp: passed (baseline, stacked and skipped on WARP).
  • startup_present_composite_overlay_removed_control_warp: passed, control ok: baseline matched, 8 fences completed, removing the overlay changed 6 of 8 cells as expected.
  • startup_present_planes and startup_present_planes_control: passed. These are unchanged; that control is pure CPU and has no setup or device path.
python -B tests/docs_links_check.py      # Checked 19 Markdown files and 509 links (exit 0)
python -B tests/bidi_controls_check.py   # no bidirectional controls (exit 0)
git diff --check origin/main...HEAD      # clean

Mutation checks (each applied locally, the target rebuilt, ctest --preset release --no-tests=error -R '^startup_present_composite_' run, then reverted):

Mutation startup_present_composite_warp control
Overlay pipeline BlendEnable = FALSE (plane_compositor.h) Failed: FAIL: stacked cell row 0 column 0: got 255,255,0,0 want 0,0,0,255 and others Failed: FAIL: regex matched
compositor.create result forced to E_FAIL Failed: FAIL: compositor setup 0x80004005 Failed: FAIL: regex matched. The old PASS_REGULAR_EXPRESSION "FAIL: " would have passed it.
Fence completed value forced to UINT64_MAX (device removal) Failed: FAIL: fence 1 not completed (completed 18446744073709551615, ...) Failed: FAIL: regex matched

After reverting, both tests pass again on the rebuilt tree.

This change was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179423190 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2647#issuecomment-7179423190). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-26T01:05:31Z. --- Thanks for reproducing it at `cb137898`. Both points are addressed in `fddd5f70` (a new commit on top; nothing rebased). **1. The negative control now passes only on success** - It is renamed `startup_present_composite_overlay_removed_control_warp`, to follow the other `_control_warp` tests. It runs the same baseline, stacked and skipped cases as `startup_present_composite_warp`. Then it removes the overlays and composites the black plane 0 alone. - It prints `control ok: baseline matched, <n> fences completed, removing the overlay changed 6 of 8 cells as expected` and exits 0 only when all of these hold: - the baseline and stacked cases matched; - every fence completed (`Gpu::run` now fails on a close or signal error, a wait that does not reach the value, or a completed value of `UINT64_MAX`), and `GetDeviceRemovedReason` reports no removal; - the overlay-free picture is black and differs from the stacked expectation in exactly the six cells the overlays draw. The other two cells must still match. - Registration: `PASS_REGULAR_EXPRESSION "control ok: baseline matched"`, `FAIL_REGULAR_EXPRESSION "FAIL: "`, `SKIP_RETURN_CODE 77` (no WARP). Every failure path prints `FAIL:`, including queue, compositor, target and plane setup. **2. Multi-plane presentation is now experimental and opt-in** - By default the window shows plane 0 alone, as on `main`. Plane 0 is the only plane drawn, through the same opaque full-window draw with a linear, clamped sampler. No swap chain is created when plane 0 cannot be drawn. - The composite runs only with `X2W_PRESENT_COMPOSITE=1`. It stays opt-in until there is a matched comparison on the same executable with this change alone. `X2W_PRESENT_PLANE=<n>` still shows plane `n` alone, with or without the switch. - The baseline capture is restored, with or without the switch. The frame capture, the presented signature, `X2W_D3D12_DUMP_SURFACE` and the `x2w-render presented` readback all read plane 0's first resource again. The `x2w-render presented` line is back to its `main` format (I dropped the mean-alpha field). - Under the switch, the highest plane above plane 0 is sampled separately on the same frames and logged as `x2w-render raw plane <i> (not composited): surface ..., sample <k>, mean level ..., mean alpha ...`. It does not touch the window copy, the note or the dump. - The `x2w-present frame <n> plane <i>/<count>` shape lines (first presents and every 300th) are still logged in both modes. They only log. - `docs/startup-runtime.md#presented-planes` and the switch table describe the default, the opt-in and the raw plane line. The fixture still tests the compositor directly, without the switch. **Results** Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088, Windows 10.0.26200, Release preset, debug layer off (the composite fixture does not enable it). Commit `fddd5f70`. ```powershell . .\tools\dev.ps1 cmake --preset release cmake --build --preset release ctest --preset release --no-tests=error -R 'present' -V ``` 14/14 passed, 0 failed, 0 skipped. Among them: - `startup_present_composite_warp`: passed (baseline, stacked and skipped on WARP). - `startup_present_composite_overlay_removed_control_warp`: passed, `control ok: baseline matched, 8 fences completed, removing the overlay changed 6 of 8 cells as expected`. - `startup_present_planes` and `startup_present_planes_control`: passed. These are unchanged; that control is pure CPU and has no setup or device path. ```powershell python -B tests/docs_links_check.py # Checked 19 Markdown files and 509 links (exit 0) python -B tests/bidi_controls_check.py # no bidirectional controls (exit 0) git diff --check origin/main...HEAD # clean ``` **Mutation checks** (each applied locally, the target rebuilt, `ctest --preset release --no-tests=error -R '^startup_present_composite_'` run, then reverted): | Mutation | `startup_present_composite_warp` | control | |---|---|---| | Overlay pipeline `BlendEnable = FALSE` (`plane_compositor.h`) | Failed: `FAIL: stacked cell row 0 column 0: got 255,255,0,0 want 0,0,0,255` and others | Failed: `FAIL:` regex matched | | `compositor.create` result forced to `E_FAIL` | Failed: `FAIL: compositor setup 0x80004005` | Failed: `FAIL:` regex matched. The old `PASS_REGULAR_EXPRESSION "FAIL: "` would have passed it. | | Fence completed value forced to `UINT64_MAX` (device removal) | Failed: `FAIL: fence 1 not completed (completed 18446744073709551615, ...)` | Failed: `FAIL:` regex matched | After reverting, both tests pass again on the rebuilt tree. This change was AI-assisted.
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!2639
No description provided.