startup-runtime: the desktop draw path is unreachable, so presented frames stay black #1261

Closed
opened 2026-11-24 06:18:41 +00:00 by triggered02 · 11 comments
triggered02 commented 2026-11-24 06:18:41 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:18:41Z.


Status update · 1 December 2026

Superseded by #3641. Subsequent local checkpoints in #870 show visible UI and presentation. The Mesh86 scene draw now reaches native PSO selection and the direct dispatch handler (#3638), with the first observed refusals at resource backing (#3639 and #3640). The historical trace below describes its original run.

Problem

Split out of #1137 (black screen after the intro video). The presented frame is black because the
desktop draw path is never entered
: every draw takes the translated/CPU path, and the render targets
the title draws into are never written, so the texture later sampled for the picture reads as zeros.

Observed

Offline run to the known null at 120 s, 3,600 frames presented, all four captured pipelines
translated and reloaded from the shader cache (pipelines translated 4 / missing 0), Windows 11
build 26200, GTX 1660 SUPER:

x2w-render totals: ... draws 0 (skipped 0), translated draws 8078 (not drawn 0),
  pipelines translated 4 / missing 0, null bindings 0, textures uploaded 0 (0 KiB, unreadable 0)
  • draws 0 (skipped 0): the desktop branch never ran, and it was not skipped either — every draw
    returned through the translated branch instead.
  • Frame dumps at frame 1500 are uniformly black: the first three dumped targets
    (3840x2160) sample 2,000 pixels each with a maximum channel value of 0.
  • The draws bind a buffer SRV at table slot 0, and one draw class binds a texture SRV that resolves
    to a known view: 3840x2160 format 28 flags 0x1 dim 3 title memory ....
  • That texture is then refused by the uploader:
    x2w-draw texture not uploaded ...: 3840x2160 format 28 flags 0x1, which is the documented
    behaviour for targets (d3d12_draw.inl: "Targets and UAVs are GPU-written and never uploaded").

Why the desktop path is unreachable

  1. list_pipeline (device slot 25) sets pass.pipeline_real from the wrapper:
    w->own().kind == pipeline_kind && w->own().real.
  2. The graphics pipelines the title creates come through device slot 62 (and 57/67), which
    deliberately return a placeholder: *out = wrap(nullptr, pipeline_kind); — real is null, so
    pipeline_real is false for every such pipeline.
  3. Only slot 86 (stream) can wrap a real desktop pipeline (build_stream_pipeline), so
    pipeline_real is reachable only for stream pipelines.
  4. For a translated pipeline the real PSO is built lazily inside the translated branch:
    pipeline_for(*bound, pass) at d3d12_draw.inl:619, after the decision has already been made.
    It is stored in bound.pipelines and never published back to the wrapper or to pass.pipeline_real.
  5. list_draw therefore always takes if (list && !pass.pipeline_real) and never reaches the
    desktop branch that requires pipeline_real && targets_bound && topology_ok && topology != 0x11 && (srv_bound & 1).

So render_draws is structurally 0 for these pipelines no matter how many pipelines translate
successfully, and the only content that exists is in the CPU path's readbacks — which are black
because the shaders sample a render target that nothing ever wrote.

Why the CPU readbacks are black

The sampled 3840x2160 R8G8B8A8 texture carries D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, and the
uploader correctly refuses it. Its contents would have to be produced by the title's own draws, which
never reach the device. Sampling it therefore returns zeros, and any shader whose output is that
sample returns black.

Proposed direction

Either make the translated pipeline's real PSO published state (create it at SetPipelineState time,
or promote it on the first draw before the branch, then let the desktop branch run), or deliberately
produce render-target contents on the CPU path before they are sampled. The first is the intended
meaning of the -Render switch as far as I can read it; the second is the fallback the issue's
"either fixed or split" allows.

Done when

A draw reaches the desktop branch (render_draws grows), or a narrower cause is identified for why
a translated pipeline must stay on the CPU path.

Context: docs/startup-runtime.md (#1135). Do not attach game files, dumps or logs that contain
addresses or names from an executable; describe results in terms of the component tested.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6575921650 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:18:41Z. --- ## Status update · 1 December 2026 Superseded by #3641. Subsequent local checkpoints in #870 show visible UI and presentation. The Mesh86 scene draw now reaches native PSO selection and the direct dispatch handler (#3638), with the first observed refusals at resource backing (#3639 and #3640). The historical trace below describes its original run. ## Problem Split out of #1137 (black screen after the intro video). The presented frame is black because **the desktop draw path is never entered**: every draw takes the translated/CPU path, and the render targets the title draws into are never written, so the texture later sampled for the picture reads as zeros. ## Observed Offline run to the known null at 120 s, 3,600 frames presented, all four captured pipelines translated and reloaded from the shader cache (`pipelines translated 4 / missing 0`), Windows 11 build 26200, GTX 1660 SUPER: ``` x2w-render totals: ... draws 0 (skipped 0), translated draws 8078 (not drawn 0), pipelines translated 4 / missing 0, null bindings 0, textures uploaded 0 (0 KiB, unreadable 0) ``` - `draws 0 (skipped 0)`: the desktop branch never ran, and it was not skipped either — every draw returned through the translated branch instead. - Frame dumps at frame 1500 are **uniformly black**: the first three dumped targets (3840x2160) sample 2,000 pixels each with a maximum channel value of 0. - The draws bind a buffer SRV at table slot 0, and one draw class binds a texture SRV that resolves to a known view: `3840x2160 format 28 flags 0x1 dim 3 title memory ...`. - That texture is then refused by the uploader: `x2w-draw texture not uploaded ...: 3840x2160 format 28 flags 0x1`, which is the documented behaviour for targets (`d3d12_draw.inl`: "Targets and UAVs are GPU-written and never uploaded"). ## Why the desktop path is unreachable 1. `list_pipeline` (device slot 25) sets `pass.pipeline_real` from the wrapper: `w->own().kind == pipeline_kind && w->own().real`. 2. The graphics pipelines the title creates come through **device slot 62** (and 57/67), which deliberately return a placeholder: `*out = wrap(nullptr, pipeline_kind);` — `real` is null, so `pipeline_real` is false for every such pipeline. 3. Only **slot 86** (stream) can wrap a real desktop pipeline (`build_stream_pipeline`), so `pipeline_real` is reachable only for stream pipelines. 4. For a translated pipeline the real PSO is built lazily **inside the translated branch**: `pipeline_for(*bound, pass)` at `d3d12_draw.inl:619`, after the decision has already been made. It is stored in `bound.pipelines` and never published back to the wrapper or to `pass.pipeline_real`. 5. `list_draw` therefore always takes `if (list && !pass.pipeline_real)` and never reaches the desktop branch that requires `pipeline_real && targets_bound && topology_ok && topology != 0x11 && (srv_bound & 1)`. So `render_draws` is structurally 0 for these pipelines no matter how many pipelines translate successfully, and the only content that exists is in the CPU path's readbacks — which are black because the shaders sample a render target that nothing ever wrote. ## Why the CPU readbacks are black The sampled 3840x2160 R8G8B8A8 texture carries `D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET`, and the uploader correctly refuses it. Its contents would have to be produced by the title's own draws, which never reach the device. Sampling it therefore returns zeros, and any shader whose output is that sample returns black. ## Proposed direction Either make the translated pipeline's real PSO published state (create it at `SetPipelineState` time, or promote it on the first draw before the branch, then let the desktop branch run), or deliberately produce render-target contents on the CPU path before they are sampled. The first is the intended meaning of the `-Render` switch as far as I can read it; the second is the fallback the issue's "either fixed or split" allows. ## Done when A draw reaches the desktop branch (`render_draws` grows), or a narrower cause is identified for why a translated pipeline must stay on the CPU path. Context: `docs/startup-runtime.md` (#1135). Do not attach game files, dumps or logs that contain addresses or names from an executable; describe results in terms of the component tested. AI-assisted (Claude Code).
R0Y00 commented 2026-11-24 06:50:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T06:30:15Z.


Thanks for the counters and the frame readbacks. The two counter families measure different paths. A zero in the stream-pipeline draw counter shows that no draw used a prebuilt desktop PSO. The translated branch can still record desktop D3D12 draws: it builds its PSO in pipeline_for and calls DrawInstanced or DrawIndexedInstanced in draw_translated. So the figures alone do not show that the target had no GPU writer.

Could you check the latest main build with #1255 and report whether the same black frame remains on the GTX 1660 SUPER? If it does, the most useful next evidence is a single frame with the translated draw targeting that intermediate texture, the corresponding queue submission or completion, and one readback before the later sample. A source-built setup or a short summary of those observations is enough. This will distinguish a missing write from a binding or sampling problem.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124000818 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7124000818). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T06:30:15Z. --- Thanks for the counters and the frame readbacks. The two counter families measure different paths. A zero in the stream-pipeline draw counter shows that no draw used a prebuilt desktop PSO. The translated branch can still record desktop D3D12 draws: it builds its PSO in `pipeline_for` and calls `DrawInstanced` or `DrawIndexedInstanced` in `draw_translated`. So the figures alone do not show that the target had no GPU writer. Could you check the latest main build with #1255 and report whether the same black frame remains on the GTX 1660 SUPER? If it does, the most useful next evidence is a single frame with the translated draw targeting that intermediate texture, the corresponding queue submission or completion, and one readback before the later sample. A source-built setup or a short summary of those observations is enough. This will distinguish a missing write from a binding or sampling problem.
triggered02 commented 2026-11-24 06:50:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:45:00Z.


Checked on latest main (fac6a522, with #1255 merged) on the GTX 1660 SUPER, and I had the "no GPU writer" part wrong — thanks for the correction. The translated branch does record desktop draws through pipeline_for and DrawInstanced, so render_draws 0 only says the other branch never ran. Here is the observation you asked for, and it does distinguish the cases.

The black frame is unchanged on latest main. Same totals as before (draws 0 (skipped 0), translated draws 8090, pipelines translated 4 / missing 0, textures uploaded 0), and the frame-1500 readbacks are still uniformly black: 3,000 sampled pixels across a 3840x2160 target, maximum channel value 0.

One frame, with the target named. I added a temporary probe (local, not in any branch) that prints the draw's target0 for frame 1500, and compared it with the resource the later draw samples:

probe frame 1500: target0 000001A5D1ED1F10  targets 1  key 7c2c1dfd37c3572d
probe frame 1500: target0 000001A5D1ED1F10  targets 1  key 80ae81ccd7078a85
probe frame 1500: target0 000001A5AFCA46B0  targets 1  key 16749053b07554ae

srv 3 texture: ... -> view known, resource 000001A5D1ED1F10, desc 40 bytes format 28   (key 16749053b07554ae)

...F10 is both the target of the earlier translated draws and the texture the later draw samples. So this is not a sampling or binding fault, and not a missing writer: the intermediate target is bound as target0 for the draws with keys 7c2c1dfd37c3572d and 80ae81ccd7078a85, those draws are recorded on the desktop, and the readback of that same target at frame 1500 is still uniformly black. The later draw sampling it therefore gets zeros for a reason that lives in the draw that renders into ...F10, not in the sampling step.

One thing that follows and may narrow it further: ...F10 is a 3840x2160 R8G8B8A8 render target, so upload_texture correctly refuses it — its contents can only come from those desktop draws. That means the question is now "why does the translated draw into that target produce black", with the candidates being the state the translated path sets for the target (RTV bind, viewport/scissor, blend), the pipeline variant chosen for that target format, or the shader's own inputs.

I have not attached the draw dumps; the numbers above describe the readback and the stand-in's own logs. I can repeat this with a source-built setup or extend the probe to print the RTV/viewport state at the same draw if that is the next thing you want.

The probe is not committed — it was a temporary local build, so nothing in this comment implies a branch or PR.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124251828 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7124251828). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:45:00Z. --- Checked on latest `main` (`fac6a522`, with #1255 merged) on the GTX 1660 SUPER, and I had the "no GPU writer" part wrong — thanks for the correction. The translated branch does record desktop draws through `pipeline_for` and `DrawInstanced`, so `render_draws 0` only says the other branch never ran. Here is the observation you asked for, and it does distinguish the cases. **The black frame is unchanged on latest main.** Same totals as before (`draws 0 (skipped 0)`, `translated draws 8090`, `pipelines translated 4 / missing 0`, `textures uploaded 0`), and the frame-1500 readbacks are still uniformly black: 3,000 sampled pixels across a 3840x2160 target, maximum channel value 0. **One frame, with the target named.** I added a temporary probe (local, not in any branch) that prints the draw's `target0` for frame 1500, and compared it with the resource the later draw samples: ``` probe frame 1500: target0 000001A5D1ED1F10 targets 1 key 7c2c1dfd37c3572d probe frame 1500: target0 000001A5D1ED1F10 targets 1 key 80ae81ccd7078a85 probe frame 1500: target0 000001A5AFCA46B0 targets 1 key 16749053b07554ae srv 3 texture: ... -> view known, resource 000001A5D1ED1F10, desc 40 bytes format 28 (key 16749053b07554ae) ``` **`...F10` is both the target of the earlier translated draws and the texture the later draw samples.** So this is not a sampling or binding fault, and not a missing writer: the intermediate target is bound as `target0` for the draws with keys `7c2c1dfd37c3572d` and `80ae81ccd7078a85`, those draws are recorded on the desktop, and the readback of that same target at frame 1500 is still uniformly black. The later draw sampling it therefore gets zeros for a reason that lives in the draw that renders into `...F10`, not in the sampling step. One thing that follows and may narrow it further: `...F10` is a 3840x2160 R8G8B8A8 render target, so `upload_texture` correctly refuses it — its contents can only come from those desktop draws. That means the question is now "why does the translated draw into that target produce black", with the candidates being the state the translated path sets for the target (RTV bind, viewport/scissor, blend), the pipeline variant chosen for that target format, or the shader's own inputs. I have not attached the draw dumps; the numbers above describe the readback and the stand-in's own logs. I can repeat this with a source-built setup or extend the probe to print the RTV/viewport state at the same draw if that is the next thing you want. The probe is not committed — it was a temporary local build, so nothing in this comment implies a branch or PR.
R0Y00 commented 2026-11-24 07:07:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T07:04:06Z.


Thanks, the matching resource identity establishes which earlier draw to inspect. Could you extend the existing probe for just that frame? A summary of RTV binding, viewport/scissor, colour write mask and the first readback immediately after one of those draws and its fence would help separate a draw-state problem from a later overwrite. If the target is already black at that point, a source-built draw with the same state and a constant nonzero pixel output would be a good control. Please keep addresses and raw captures local.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124579440 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7124579440). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T07:04:06Z. --- Thanks, the matching resource identity establishes which earlier draw to inspect. Could you extend the existing probe for just that frame? A summary of RTV binding, viewport/scissor, colour write mask and the first readback immediately after one of those draws and its fence would help separate a draw-state problem from a later overwrite. If the target is already black at that point, a source-built draw with the same state and a constant nonzero pixel output would be a good control. Please keep addresses and raw captures local.
triggered02 commented 2026-11-24 08:01:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T07:16:27Z.


Extended the probe for frame 1500 only, and the draw state is clean — so this is not a draw-state problem. Numbers below; addresses and raw captures stay local, as asked.

Draw state at the draw that renders into the intermediate target (frame 1500, both draws that write it):

key 7c2c1dfd37c3572d  target ...B000  format 28  targets_bound 1  write_mask 0xf
  viewport 0.0,0.0 3840.0x2160.0  depth 0.0..1.0  scissor 0,0..3840,2160  pipeline <non-null>
key 80ae81ccd7078a85  target ...B000  format 28  targets_bound 1  write_mask 0xf
  viewport 0.0,0.0 3840.0x2160.0  depth 0.0..1.0  scissor 0,0..3840,2160  pipeline <non-null>

First readback immediately after each of those draws (the existing per-draw dump, which takes its readback after the draw's fence, so it is before any later draw can overwrite): black. All six dumps at that frame are uniformly black — 1,500 to 3,000 sampled pixels per target, maximum channel value 0. The target is black at the point R0Y00 asked about, not later.

So: RTV bound and correct format, full viewport, full scissor, all four colour channels writable, real PSO. The draw executes with nothing wrong in its state and produces no fragments. That points at the vertex data rather than the draw state, and there is a concrete lead: the pixel shader writes only the flat parameter, and the vertex shader gets its positions by decoding the fetch table in the shader — offset (desc >> 7) & 0x1fffffc = 17, stride 28, so it reads at bytes 17, 45, 73 of the bound buffer, while that buffer holds -1.0f at byte 16 and 1.0f at byte 20. Reads one byte off a clean position pair would give garbage vertices, which clip and write nothing.

Next, per your suggestion, is the control: a source-built draw with this same state and a constant nonzero pixel output, to prove this target can receive a write under the launcher at all. If that control writes as expected, the remaining question is the vertex fetch decode (translation) versus which address is bound for root parameter 0.

The probe was temporary and is reverted; nothing is committed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124808772 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7124808772). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T07:16:27Z. --- Extended the probe for frame 1500 only, and the draw state is clean — so this is not a draw-state problem. Numbers below; addresses and raw captures stay local, as asked. **Draw state at the draw that renders into the intermediate target** (frame 1500, both draws that write it): ``` key 7c2c1dfd37c3572d target ...B000 format 28 targets_bound 1 write_mask 0xf viewport 0.0,0.0 3840.0x2160.0 depth 0.0..1.0 scissor 0,0..3840,2160 pipeline <non-null> key 80ae81ccd7078a85 target ...B000 format 28 targets_bound 1 write_mask 0xf viewport 0.0,0.0 3840.0x2160.0 depth 0.0..1.0 scissor 0,0..3840,2160 pipeline <non-null> ``` **First readback immediately after each of those draws** (the existing per-draw dump, which takes its readback after the draw's fence, so it is before any later draw can overwrite): black. All six dumps at that frame are uniformly black — 1,500 to 3,000 sampled pixels per target, maximum channel value 0. The target is black at the point R0Y00 asked about, not later. So: RTV bound and correct format, full viewport, full scissor, all four colour channels writable, real PSO. The draw executes with nothing wrong in its state and produces no fragments. That points at the vertex data rather than the draw state, and there is a concrete lead: the pixel shader writes only the flat parameter, and the vertex shader gets its positions by decoding the fetch table in the shader — offset `(desc >> 7) & 0x1fffffc` = 17, stride 28, so it reads at bytes 17, 45, 73 of the bound buffer, while that buffer holds `-1.0f` at byte 16 and `1.0f` at byte 20. Reads one byte off a clean position pair would give garbage vertices, which clip and write nothing. Next, per your suggestion, is the control: a source-built draw with this same state and a constant nonzero pixel output, to prove this target can receive a write under the launcher at all. If that control writes as expected, the remaining question is the vertex fetch decode (translation) versus which address is bound for root parameter 0. The probe was temporary and is reverted; nothing is committed.
triggered02 commented 2026-11-24 08:01:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T07:57:45Z.


The control you asked for already exists in the tree and passes on this machine, so that half of the question is answered: a source-built draw with a constant nonzero output does write, and the readback is exact.

startup_stream_draw compiles a constant-colour shader with FXC at test time, records a draw through the stand-ins, submits it, waits on its fence and checks every pixel, on both backends:

228: warp:     red/green draws exact, 32 RGBA pixels each; swapped shader differs at 16 of 32   -> Passed 1.91 s
232: hardware: red/green draws exact, 32 RGBA pixels each; swapped shader differs at 16 of 32   -> Passed 2.25 s

(The swapped-shader check matters on its own: changing only the shader colour changes exactly the 16 covered pixels, so those pixels are coming from the shader and not from a cleared target.)

Hardware here is the GTX 1660 SUPER that shows the black frame, so this is not a "the driver cannot write to an offscreen target" problem, and it is not a readback problem.

What this does not yet cover is state parity with the failing draw. The control draws into its own small target; the failing draw is 3840x2160, format 28, full viewport and scissor, write mask 0xf. If you want that gap closed, the next step is to parameterise the control to exactly that state (same size, format, viewport, scissor, mask) and re-run — I can do that in the same fixture rather than writing a new one.

So, combining with the draw-state evidence from before: the target can receive a write from a translated draw on this adapter, and at the failing draw the state is all correct and the readback is black. That keeps the vertex-data lead as the remaining explanation — the shader that renders into it writes only its flat parameter, and the vertex fetch decode reads at byte 17 with stride 28 while the bound buffer holds -1.0/1.0 at bytes 16/20.

Nothing committed; no addresses or raw captures included.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7125566290 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7125566290). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T07:57:45Z. --- The control you asked for already exists in the tree and passes on this machine, so that half of the question is answered: a source-built draw with a constant nonzero output does write, and the readback is exact. `startup_stream_draw` compiles a constant-colour shader with FXC at test time, records a draw through the stand-ins, submits it, waits on its fence and checks every pixel, on both backends: ``` 228: warp: red/green draws exact, 32 RGBA pixels each; swapped shader differs at 16 of 32 -> Passed 1.91 s 232: hardware: red/green draws exact, 32 RGBA pixels each; swapped shader differs at 16 of 32 -> Passed 2.25 s ``` (The swapped-shader check matters on its own: changing only the shader colour changes exactly the 16 covered pixels, so those pixels are coming from the shader and not from a cleared target.) Hardware here is the GTX 1660 SUPER that shows the black frame, so this is not a "the driver cannot write to an offscreen target" problem, and it is not a readback problem. **What this does not yet cover** is state parity with the failing draw. The control draws into its own small target; the failing draw is 3840x2160, format 28, full viewport and scissor, write mask 0xf. If you want that gap closed, the next step is to parameterise the control to exactly that state (same size, format, viewport, scissor, mask) and re-run — I can do that in the same fixture rather than writing a new one. So, combining with the draw-state evidence from before: the target can receive a write from a translated draw on this adapter, and at the failing draw the state is all correct and the readback is black. That keeps the vertex-data lead as the remaining explanation — the shader that renders into it writes only its flat parameter, and the vertex fetch decode reads at byte 17 with stride 28 while the bound buffer holds `-1.0`/`1.0` at bytes 16/20. Nothing committed; no addresses or raw captures included.
R0Y00 commented 2026-11-24 09:04:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T08:17:28Z.


The existing constant-color draw and its swapped-shader control are a useful baseline on the affected adapter. Please reuse that fixture for the matching target, viewport, scissor and mask, then vary the tested vertex byte offset while keeping the same input and shader. #1316 now validates full-address placed vertex bounds on main; check whether the binding in the reproducer resolves to the intended allocation and byte range. Keep the first differing byte/field and the observed pixel counts. This can distinguish a layout or binding discrepancy from the constant-color output path.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7125955305 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7125955305). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T08:17:28Z. --- The existing constant-color draw and its swapped-shader control are a useful baseline on the affected adapter. Please reuse that fixture for the matching target, viewport, scissor and mask, then vary the tested vertex byte offset while keeping the same input and shader. #1316 now validates full-address placed vertex bounds on main; check whether the binding in the reproducer resolves to the intended allocation and byte range. Keep the first differing byte/field and the observed pixel counts. This can distinguish a layout or binding discrepancy from the constant-color output path.
triggered02 commented 2026-11-24 09:04:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T08:22:56Z.


Checking the fixture against the failing state turned up two mismatches worth fixing before the sweep is meaningful, so I want to state them rather than run a control that only looks like a match.

What startup_stream_draw actually uses today (tests/startup_stream_draw.cpp:187-222):

state existing control failing draw
target size 8x4, or the BC7 sizes 64x64 / 81x69 3840x2160
format R8G8B8A8_UNORM R8G8B8A8_UNORM (matches)
viewport full width/height full 3840x2160 (matches)
scissor bc7 ? width : width/2 — half-width for the plain case full 3840x2160
write mask PSO default 0xf both

So the control matches on format, viewport and mask, and differs on size and — more importantly — on scissor: the plain path deliberately uses a half-width scissor, which is exactly a state difference that could mask or mimic a rasterisation problem. I would rather parameterise those two than run a "matching" control that does not actually match.

#1316 is merged, so the full-address placed-vertex resolution is in main and the sweep exercises the bound path rather than the old transient copy. In this fixture the vertex binding for the plain draw goes through list slot 36 (root SRV) with the guest address, which is what #1316 now resolves against the placement records — so varying that guest byte offset is the right knob.

Plan for the mode, in the same fixture rather than a new one:

  1. Target 3840x2160, format 28, full viewport and full scissor, mask 0xf — the failing state exactly.
  2. Same input bytes and same shader for every run; vary only the guest address byte offset handed to the binding, across a small set (0, and offsets that put the view start inside and just past the recorded allocation).
  3. Record, per offset: the pixel count (covered pixels, and the distinct colours), the first differing byte and its field against the unshifted run, and whether the binding resolved to the intended allocation and byte range.
  4. Keep the existing red/green swapped-shader check as the control that the pixels still come from the shader.

Expected reading: if the offset is honoured, the covered-pixel count stays constant until the view leaves the allocation; if the binding ignores or mis-bounds the offset, the first differing byte will move or the count will change at an offset that should still be valid. That is the classification you asked for, and it separates a binding/layout discrepancy from the constant-colour output path.

I have not changed the fixture yet — this step is the state parity plus the sweep, and I will report the first differing byte and the pixel counts rather than a pass/fail summary. If you would rather I run the imperfect control first for a data point before doing that work, say so and it is two minutes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7126065417 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7126065417). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T08:22:56Z. --- Checking the fixture against the failing state turned up two mismatches worth fixing before the sweep is meaningful, so I want to state them rather than run a control that only looks like a match. **What `startup_stream_draw` actually uses today** (tests/startup_stream_draw.cpp:187-222): | state | existing control | failing draw | |---|---|---| | target size | 8x4, or the BC7 sizes 64x64 / 81x69 | **3840x2160** | | format | R8G8B8A8_UNORM | R8G8B8A8_UNORM (matches) | | viewport | full width/height | full 3840x2160 (matches) | | scissor | `bc7 ? width : width/2` — **half-width** for the plain case | **full 3840x2160** | | write mask | PSO default | 0xf both | So the control matches on format, viewport and mask, and differs on size and — more importantly — on scissor: the plain path deliberately uses a half-width scissor, which is exactly a state difference that could mask or mimic a rasterisation problem. I would rather parameterise those two than run a "matching" control that does not actually match. **#1316 is merged**, so the full-address placed-vertex resolution is in main and the sweep exercises the bound path rather than the old transient copy. In this fixture the vertex binding for the plain draw goes through list slot 36 (root SRV) with the guest address, which is what #1316 now resolves against the placement records — so varying that guest byte offset is the right knob. **Plan for the mode**, in the same fixture rather than a new one: 1. Target 3840x2160, format 28, full viewport and full scissor, mask 0xf — the failing state exactly. 2. Same input bytes and same shader for every run; vary only the guest address byte offset handed to the binding, across a small set (0, and offsets that put the view start inside and just past the recorded allocation). 3. Record, per offset: the pixel count (covered pixels, and the distinct colours), the **first differing byte and its field** against the unshifted run, and whether the binding resolved to the intended allocation and byte range. 4. Keep the existing red/green swapped-shader check as the control that the pixels still come from the shader. Expected reading: if the offset is honoured, the covered-pixel count stays constant until the view leaves the allocation; if the binding ignores or mis-bounds the offset, the first differing byte will move or the count will change at an offset that should still be valid. That is the classification you asked for, and it separates a binding/layout discrepancy from the constant-colour output path. I have not changed the fixture yet — this step is the state parity plus the sweep, and I will report the first differing byte and the pixel counts rather than a pass/fail summary. If you would rather I run the imperfect control first for a data point before doing that work, say so and it is two minutes.
R0Y00 commented 2026-11-24 09:04:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T08:28:33Z.


The target-size and full-scissor control is worth running. One correction for the offset sweep: #1316 observes slot 48 vertex-buffer views, so the slot 36 root SRV does not by itself exercise that placement lookup. Use the placed-vertex fixture for the slot 48 sweep, or report the root-SRV and placed-vertex routes as separate cases. In either case the offset changes what bytes the shader sees, so keep the in-range expected output explicit and use a separate out-of-range null control. Please retain the original half-scissor case as a regression.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7126179902 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7126179902). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T08:28:33Z. --- The target-size and full-scissor control is worth running. One correction for the offset sweep: #1316 observes slot 48 vertex-buffer views, so the slot 36 root SRV does not by itself exercise that placement lookup. Use the placed-vertex fixture for the slot 48 sweep, or report the root-SRV and placed-vertex routes as separate cases. In either case the offset changes what bytes the shader sees, so keep the in-range expected output explicit and use a separate out-of-range null control. Please retain the original half-scissor case as a regression.
triggered02 commented 2026-11-24 09:04:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T08:34:41Z.


Correction taken, and it changes the plan: you are right that #1316 observes slot 48 vertex-buffer views, so a slot 36 root SRV does not exercise the placement lookup at all. My plan named slot 36, which would have swept a route that cannot touch the code being validated.

Revised, following your split:

  • Placed-vertex case (slot 48): reuse the placed-vertex fixture for the offset sweep, since that is the path #1316 resolves. Same input bytes and shader across offsets, with the in-range expected output stated explicitly per offset, plus a separate out-of-range null control where the view start leaves the recorded allocation and the draw must not silently read something else.
  • Root-SRV case (slot 36): reported as a separate case rather than folded into the same sweep, so the two routes are not conflated in the results.
  • State parity: target 3840x2160, format 28, full viewport and full scissor, mask 0xf, as the matching control.
  • The original half-scissor case stays as a regression, unchanged.
  • Per offset I will record the covered-pixel count, the distinct colours, the first differing byte and its field, and whether the binding resolved to the intended allocation and byte range.

I have not started the fixture changes yet; when I report these numbers I will say which route each one came from rather than a combined summary.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7126304231 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7126304231). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T08:34:41Z. --- Correction taken, and it changes the plan: you are right that #1316 observes **slot 48** vertex-buffer views, so a slot 36 root SRV does not exercise the placement lookup at all. My plan named slot 36, which would have swept a route that cannot touch the code being validated. Revised, following your split: - **Placed-vertex case (slot 48)**: reuse the placed-vertex fixture for the offset sweep, since that is the path #1316 resolves. Same input bytes and shader across offsets, with the in-range expected output stated explicitly per offset, plus a separate out-of-range null control where the view start leaves the recorded allocation and the draw must not silently read something else. - **Root-SRV case (slot 36)**: reported as a separate case rather than folded into the same sweep, so the two routes are not conflated in the results. - **State parity**: target 3840x2160, format 28, full viewport and full scissor, mask 0xf, as the matching control. - **The original half-scissor case stays** as a regression, unchanged. - Per offset I will record the covered-pixel count, the distinct colours, the first differing byte and its field, and whether the binding resolved to the intended allocation and byte range. I have not started the fixture changes yet; when I report these numbers I will say which route each one came from rather than a combined summary.
stan495 commented 2026-11-24 10:02:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T09:36:35Z.


Independent Windows run on the #1316 merge commit a166e42f169b18cc4323b7586e14426671466f85. Windows 11 25H2 build 26200.9974, x64 MSVC Release, D3D12 debug layer off. The hardware draws selected Radeon RX 7900 XTX (32.0.32029.2010). WARP reported Microsoft Basic Render Driver (10.0.26100.9818).

cmake --build --preset release --target startup_stream_consumer --parallel 10
ctest --preset release --no-tests=error -R '^startup_(placed_vertex|address_srv|address_bc_view|stream_draw|xg_bc_chain)_' -V

All 10 source-built tests passed (5 hardware, 5 WARP), with 0 failures and 0 capability skips. placed_vertex matched all 64 expected RGBA pixels on each backend, including the out-of-bounds view that read zero from a null descriptor.

For the local Scarlett x64 executable, I used the documented offline launcher with -Seconds 180 -MemoryGiB 14 -Render -FakeUser -GpuMirror -ContinueAsserts 1000 -InputScript '4@70' on an isolated package copy. The cold cache run kept presenting with zero translated draws. All 18 sampled surfaces were black and the run emitted 11 pipeline requests. gfx2hlsl.py --pending compiled 10. One remained unsupported with image dimension SQ_RSRC_IMG_2D_ARRAY.

The first replay stopped at 17.82 s on a second-chance null write (0xc0000005 in vcruntime140.dll). A repeat with the same flags and cache ran to the 180 s timeout. The Bink header reached frame 450/450, and the last 15 sampled surfaces had nonzero RGB through about 175 s from launch, including samples well after video frames began advancing. The final heartbeat reported 4,609 presents in 160.2 s from first present (28.8 fps overall). At frame 4,500 the totals were desktop draws 0 (skipped 0), translated draws 82,086 (not drawn 6,171), pipelines translated/missing 10/1, and null bindings 454. An early 3840×2160 format-28 render-target upload was refused. I did not observe the sustained post-intro black screen on the repeat. The cache coverage and binding counts differ from the 4/0, zero-null-binding case in #1268, and the ~8 s surface sampling could miss brief black frames.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7127647900 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7127647900). Originally posted by [stan495](https://github.com/stan495) on 2026-11-24T09:36:35Z. --- Independent Windows run on the #1316 merge commit `a166e42f169b18cc4323b7586e14426671466f85`. Windows 11 25H2 build 26200.9974, x64 MSVC Release, D3D12 debug layer off. The hardware draws selected Radeon RX 7900 XTX (`32.0.32029.2010`). WARP reported Microsoft Basic Render Driver (`10.0.26100.9818`). ```powershell cmake --build --preset release --target startup_stream_consumer --parallel 10 ctest --preset release --no-tests=error -R '^startup_(placed_vertex|address_srv|address_bc_view|stream_draw|xg_bc_chain)_' -V ``` All 10 source-built tests passed (5 hardware, 5 WARP), with 0 failures and 0 capability skips. `placed_vertex` matched all 64 expected RGBA pixels on each backend, including the out-of-bounds view that read zero from a null descriptor. For the local Scarlett x64 executable, I used the documented offline launcher with `-Seconds 180 -MemoryGiB 14 -Render -FakeUser -GpuMirror -ContinueAsserts 1000 -InputScript '4@70'` on an isolated package copy. The cold cache run kept presenting with zero translated draws. All 18 sampled surfaces were black and the run emitted 11 pipeline requests. `gfx2hlsl.py --pending` compiled 10. One remained unsupported with `image dimension SQ_RSRC_IMG_2D_ARRAY`. The first replay stopped at 17.82 s on a second-chance null write (`0xc0000005` in `vcruntime140.dll`). A repeat with the same flags and cache ran to the 180 s timeout. The Bink header reached frame 450/450, and the last 15 sampled surfaces had nonzero RGB through about 175 s from launch, including samples well after video frames began advancing. The final heartbeat reported 4,609 presents in 160.2 s from first present (28.8 fps overall). At frame 4,500 the totals were desktop draws 0 (skipped 0), translated draws 82,086 (not drawn 6,171), pipelines translated/missing 10/1, and null bindings 454. An early 3840×2160 format-28 render-target upload was refused. I did not observe the sustained post-intro black screen on the repeat. The cache coverage and binding counts differ from the 4/0, zero-null-binding case in #1268, and the ~8 s surface sampling could miss brief black frames.
lambirou commented 2026-11-26 13:03:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-26T12:31:52Z.


I opened a draft for the first bounded pixel-history slice: #2828.

It adds X2W_DRAW_DUMP_PIXEL=, next to X2W_DRAW_DUMP_FRAME. Each recorded copy then covers one texel of render target 0 instead of the whole target, and the present writes pixel_history.txt with the draw ordinal, the translated manifest key, the draw count, the raw word and the decoded RGBA value. The 48-copy bound is unchanged.

The source-built fixture draws three times on a 4x4 target: the first and third draws are scissored away from the watched texel, so only the second changes it. The report must name draw 2 and its key; the control without that draw must leave the texel black. WARP and an RX 9060 XT pass 2/2.

This is deliberately limited to the 8-bit four-channel formats the full dump already supports. It should make the next frame-1500-style readback name the last draw that changed a pixel instead of only showing that the target is black.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7192121331 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1268#issuecomment-7192121331). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-26T12:31:52Z. --- I opened a draft for the first bounded pixel-history slice: #2828. It adds X2W_DRAW_DUMP_PIXEL=<x>,<y> next to X2W_DRAW_DUMP_FRAME. Each recorded copy then covers one texel of render target 0 instead of the whole target, and the present writes pixel_history.txt with the draw ordinal, the translated manifest key, the draw count, the raw word and the decoded RGBA value. The 48-copy bound is unchanged. The source-built fixture draws three times on a 4x4 target: the first and third draws are scissored away from the watched texel, so only the second changes it. The report must name draw 2 and its key; the control without that draw must leave the texel black. WARP and an RX 9060 XT pass 2/2. This is deliberately limited to the 8-bit four-channel formats the full dump already supports. It should make the next frame-1500-style readback name the last draw that changed a pixel instead of only showing that the target is black.
Sign in to join this conversation.
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#1261
No description provided.