Repository navigation
runtime: draw every plane under the composite switch - #3376
Conversation
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — clean refactor with clear rationale.
Multi-plane presents now composite every drawable plane by default (plane 0 alone was measured black while plane 1 held the picture). Extracts PlaneSelection and select_presented_planes() from present_planes.h; X2W_PRESENT_PLANE still takes priority. Compositor capacity is fixed on the first present. Docs and tests updated consistently.
Ready to land.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — clean refactor, well-tested.
Introduces PlaneSelection struct and select_presented_planes() to replace the old inline logic. Multi-plane presents now composite every drawable plane by default (plane 0 alone was measured black on Series S); one-plane presents stay plane 0 alone. X2W_PRESENT_PLANE still takes priority. Compositor capacity is fixed on first present so later multi-plane presents work. Documentation updated to reflect the new default. Tests cover selection policy thoroughly.
Ready to land.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — sensible default for multi-plane presents.
Plane selection now composites every drawable plane by default for multi-plane presents, fixing the case where plane 0 is black but a higher plane holds the picture. One-plane presents stay plane-0-alone. PlaneSelection struct and select_presented_planes() encapsulate the policy cleanly. X2W_PRESENT_PLANE= still overrides and takes priority. Compositor capacity is fixed on the first present.
Test comments updated for the new selection policy. Documentation reflects the default change and diagnostic status of X2W_PRESENT_COMPOSITE.
Ready to land.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — sensible default for multi-plane presents.
Plane selection now composites every drawable plane by default for multi-plane presents, fixing the case where plane 0 is black but a higher plane holds the picture. One-plane presents stay plane-0-alone. PlaneSelection struct and select_presented_planes() encapsulate the policy cleanly. X2W_PRESENT_PLANE= still overrides and takes priority. Compositor capacity is fixed on the first present.
Test comments updated for the new selection policy. Documentation reflects the default change and diagnostic status of X2W_PRESENT_COMPOSITE.
Ready to land.
Leyukaka
left a comment
There was a problem hiding this comment.
Reviewed 07f795d by reading the diff; not built or run. The selection logic is correct: with both switches unset a multi-plane present keeps every plane, a one-plane present keeps plane 0, and X2W_PRESENT_PLANE wins. git merge-tree is clean on main 212d4b5 and conflicts with #3373 in presented_planes(); this PR contains #3373's planes > 1 policy, so one of the two should close.
- The capacity change is needed:
PlaneCompositor::recordstops atmax_planes_, so with capacity 1 only the first drawable plane is drawn. No test checks the capacity passed atpresent_to_window(..., presented.drawable, window_planes): the tests callselect_presented_planesandcompositor.create(..., 1)/(..., 4)directly, so restoringpresent_composite_enabled() ? window_planes : 1would not fail any of them. - New failure path on the default.
PlaneCompositor::createhasif (SUCCEEDED(hr) && max_planes_ > 1) hr = D3DCompile(..., "ps_over", ...), then createsblend_, and ends withif (FAILED(hr)) release();.present_to_windowhasif (!p.chain && !create_window_presenter(queue, window, plane_capacity)) { p.failed = true; return false; }and returns early onp.failedfrom then on. Main passed capacity 1 unless the switch was set, sops_overandblend_were never created there. Now every render-mode run creates them, and a failure turns the output window off for the whole run, one-plane presents included, which only needopaque_. Could a blend failure leave the one-plane path working (keepopaque_, drop to capacity 1)? I have not seen this failure happen. - docs/startup-runtime.md on main says: "It stays opt-in until a matched comparison on the same executable, with this change alone, shows what it does to a real present." The PR removes that sentence and reports synthetic tests only. Either add that comparison, or state in the doc why the condition is dropped.
X2W_PRESENT_COMPOSITE=1no longer changes what the window shows: for one plane,allandonly = 0select the same plane. Its only remaining effect is the raw-plane sample. The env table could say so.startup_present_planes(_control)andstartup_present_composite_*are not in theprtest preset filter, so CI on this PR ran none of them. Under--control,defaults_to_alliscontrol ? false : select_presented_planes(planes, -1, false).all: the two control rows return a constant and do not call the function.
|
Re-reviewed at 07f795d against main 77d1ba4 (by reading the code, plus a local g++ run of the pure MUST
SHOULD NIT Holding, not merging, until 1 is resolved. AI-assisted. |
|
SHOULD 3 is resolved: #3373 was closed in favour of this pull request, so there is no longer a competing \planes > 1\ change in \presented_planes(). MUST 1 (the default flip without a real-present comparison) and SHOULD 2 (the \X2W_PRESENT_COMPOSITE\ entry in \ ools/startup/run_presets.json) are the author's to settle; neither can be answered from this account, which has no title run. |
…ault # Conflicts: # src/startup_stubs/d3d12_xs_device.cpp
|
Re-reviewed the delta at 54a5965 (5 commits since 07f795d), by reading the diff and the failed CI log; no builds. CI is red, and it comes from this PR. "Build and test on Windows" fails: Delta status
Not merging while CI is red and the MUST stands. AI-assisted review. |
|
Review follow-up pushed at What changed:
The MUST-1 evidence question is not fabricated here: the doc now says the comparison is still missing. On my side, local checks: The Windows job 9239 is running on |
|
I addressed the review points on the refreshed head
Matched 150 s title runs on the same Release build and package show two drawable planes in both cases. Plane 0 readback is 0.00/255; the forced I will keep the PR open until a longer picture-bearing run is available or a maintainer accepts the measured case as sufficient. |
|
Windows checks run 9239 is green on The four present tests now build and run in the The PR is |
|
I tried to produce the missing real-present A/B on Release build, Series S profile (
That is the gap the integration stack fixes with The documentation keeps the honest statement: the default is covered by the selection and capacity tests and by the documented measured Series S case, but not by a matched real-present A/B. If the maintainer is willing to land on that basis, the PR is ready; otherwise it needs a run from a branch that also carries the view-token/placed-buffer fix, which would no longer be "this change alone". Run: |
|
Re-reviewed the delta at b86a144 by reading the diff and the thread; no builds. Resolved since 54a5965: CI is green (the four present tests are now in the Still open, MUST: the multi-plane default is still flipped, and the only gate main had ("stays opt-in until a matched comparison on the same executable, with this change alone...") is now reworded to say the comparison has not been made. The author's latest comment says it can't be produced on this branch (both runs stay on a black loading surface), which I take at face value. That leaves the gate dropped on the strength of the synthetic WARP fixtures and the one documented measured case, so this needs a maintainer to say so, either in the PR or in the doc. Alternatively the flip could land opt-in (selection unchanged unless SHOULD (carried): the one-plane retry when the composite pipeline can't be created is untested, as the doc itself says. Fine to land as documented, but nothing would catch it regressing. Not merging until the maintainer decision on the default. AI-assisted review. |
|
Took the opt-in alternative from the last review at
PR title and body updated to match. CI is running on |
|
Windows checks run 9241 is green on The PR is |
|
Re-reviewed the delta b86a144..43512b7 (one commit) by reading the diff; no builds. MUST 1 is resolved by the opt-in landing. Two notes, neither blocking:
Merged at 43512b7 (squash, 47c30fe). AI-assisted review. |
|
I can now provide the matched comparison on the integration stack that actually draws. Same executable and settings; only the plane selection changes:
The PR branch alone still cannot produce this because it lacks the stack's compute/draw fixes; the black loading surface there is not caused by the plane selection. The selection change is validated on the executable that can draw, with the default composition showing the picture and plane 0 alone staying black. The opt-in fallback remains possible if the maintainer prefers to land the capacity fix alone, but the evidence now supports the default. |
X2W_PRESENT_COMPOSITE=1existed, but the window presenter's capacity is fixed on the first present and was passed aspresent_composite_enabled() ? window_planes : 1. The selection policy and capacity were inline, and a failed blend pipeline disabled the output window entirely.This extracts the selection into
select_presented_planes()(present_planes.h) and the capacity intowindow_plane_capacity.h, always passes the fullwindow_planescapacity, and retries with one plane if the multi-plane pipeline cannot be created. The default is unchanged: plane 0 alone.X2W_PRESENT_PLANE=<n>still wins over the switch.The default flip is left for a follow-up once a matched real-present comparison is available on a branch that reaches a picture-bearing frame. On current
mainthe title stays on a black loading surface (8,595 compute refusals,draws 0), so a default-vs-X2W_PRESENT_PLANE=0comparison would compare two black surfaces.tools/startup/run_presets.jsonkeepsX2W_PRESENT_COMPOSITE=1inbase, so preset runs use the switch.Review follow-up (2026-11-30): took the reviewer's opt-in alternative. The selection extraction, capacity test, fallback, presets and documentation stay; only the default is reverted.
Tests:
4/4 passed on WARP; the
--controlpath prints the expectedFAIL:lines, including the withdrawn compose-by-default policy and the old capacity of one plane.python -B tests/docs_links_check.py: 179 Markdown files and 718 links passed.Refs #3373.