[bug] Described graphics pipelines that read title memory are refused, so the first draw of every frame is dropped #303

Open
opened 2026-11-27 10:19:44 +00:00 by lewisenator · 8 comments
lewisenator commented 2026-11-27 10:19:44 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lewisenator on 2026-11-27T10:19:44Z.


What is wrong

render_pipe refuses any graphics pipeline whose state isn't guessed if one of its shaders reads title memory through the page table: reads title memory through the page table in a graphics pipeline. But the render binding already gives the page table to every stage (Binding::memory), and guessed and described pipelines go through the same make_render. As far as I can tell the gate has no technical reason to exist. It's in crates/victory-gpu/src/native/shaders.rs (unsupported, refusal).

What it costs

One shader pair hits it: vertex dfafaf38…, pixel 06295fb1…. It's the first draw of each frame, from frame 2 on. The vertex shader takes a root descriptor's address, builds a buffer descriptor from it, reads an input-layout record, then fetches a float3 position and a float4 colour. The pixel shader writes the interpolated colour straight out.

On 774540f that was no_pipeline=28431 over 14,848 frames (8.4 minutes, M4 Max 128 GB, Series X, macOS 27.2). I get the same refusal on c1b9587. #246 has it too, on an M1 Max.

What I don't know

Whether this draw matters for the picture. On c1b9587 the setup screens render with or without it, and I haven't found what the draw contributes. This is not a fix for #258.

What I'm going to do

Remove the gate and the memory parameter that carried it. That's on a local branch, with a Metal test that draws the same shaders with a described state (it fails with the gate put back) and a section in docs/native-host.md. The x86_64 tests, the native tests, the Windows-target clippy and cargo xtask policy pass. cargo test --workspace failed once in the loader on the flaky test from #281. I'll open a draft PR once this is claimed.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6644472739 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303). Originally posted by [lewisenator](https://github.com/lewisenator) on 2026-11-27T10:19:44Z. --- **What is wrong** `render_pipe` refuses any graphics pipeline whose state isn't guessed if one of its shaders reads title memory through the page table: `reads title memory through the page table in a graphics pipeline`. But the render binding already gives the page table to every stage (`Binding::memory`), and guessed and described pipelines go through the same `make_render`. As far as I can tell the gate has no technical reason to exist. It's in `crates/victory-gpu/src/native/shaders.rs` (`unsupported`, `refusal`). **What it costs** One shader pair hits it: vertex `dfafaf38…`, pixel `06295fb1…`. It's the first draw of each frame, from frame 2 on. The vertex shader takes a root descriptor's address, builds a buffer descriptor from it, reads an input-layout record, then fetches a float3 position and a float4 colour. The pixel shader writes the interpolated colour straight out. On 774540f that was `no_pipeline=28431` over 14,848 frames (8.4 minutes, M4 Max 128 GB, Series X, macOS 27.2). I get the same refusal on c1b9587. #246 has it too, on an M1 Max. **What I don't know** Whether this draw matters for the picture. On c1b9587 the setup screens render with or without it, and I haven't found what the draw contributes. This is not a fix for #258. **What I'm going to do** Remove the gate and the `memory` parameter that carried it. That's on a local branch, with a Metal test that draws the same shaders with a described state (it fails with the gate put back) and a section in `docs/native-host.md`. The x86_64 tests, the native tests, the Windows-target clippy and `cargo xtask policy` pass. `cargo test --workspace` failed once in the loader on the flaky test from #281. I'll open a draft PR once this is claimed.
lewisenator commented 2026-11-27 10:19:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lewisenator on 2026-11-27T10:19:48Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7215754152 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7215754152). Originally posted by [lewisenator](https://github.com/lewisenator) on 2026-11-27T10:19:48Z. --- /claim
github-actions[bot] commented 2026-11-27 10:19:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T10:19:59Z.


Claimed by @lewisenator. Open a draft pull request with Refs #303 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7215757782 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7215757782). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T10:19:59Z. --- Claimed by @lewisenator. Open a draft pull request with `Refs #303` in its description within 24 hours, or the claim expires.
LakshanSivakumar commented 2026-11-27 10:32:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T10:32:05Z.


Thank you. This is the same pair I counted in the log of #258 (vertex dfafaf38..., pixel 06295fb1..., one refusal), so it shows on an M1 Max too.

I do not know why the gate is there and I cannot tell you it has no reason. Before a pull request I would like three things: what the vertex shader's root descriptor points at (title memory read through the page table is the case the gate stops, so please say what the read does and how you know); a Metal test with values for that read through a described pipeline, not only that the draw is encoded; and what the draw puts on the screen, or that you could not tell. A draft pull request with those is welcome. Counts and ids only, no shader bytes. I have not run any of this.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7215999510 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7215999510). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T10:32:05Z. --- Thank you. This is the same pair I counted in the log of #258 (vertex `dfafaf38...`, pixel `06295fb1...`, one refusal), so it shows on an M1 Max too. I do not know why the gate is there and I cannot tell you it has no reason. Before a pull request I would like three things: what the vertex shader's root descriptor points at (title memory read through the page table is the case the gate stops, so please say what the read does and how you know); a Metal test with values for that read through a described pipeline, not only that the draw is encoded; and what the draw puts on the screen, or that you could not tell. A draft pull request with those is welcome. Counts and ids only, no shader bytes. I have not run any of this.
github-actions[bot] commented 2026-11-28 10:34:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T10:34:29Z.


The claim by @lewisenator has expired: no pull request referenced it within 24 hours. This issue is free to claim.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7237984777 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7237984777). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T10:34:29Z. --- The claim by @lewisenator has expired: no pull request referenced it within 24 hours. This issue is free to claim.
AnastasisKon commented 2026-11-28 11:26:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T11:26:15Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7238550750 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7238550750). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T11:26:15Z. --- /claim
github-actions[bot] commented 2026-11-28 11:26:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T11:26:30Z.


Claimed by @AnastasisKon. Open a draft pull request with Refs #303 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7238553385 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7238553385). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T11:26:30Z. --- Claimed by @AnastasisKon. Open a draft pull request with `Refs #303` in its description within 24 hours, or the claim expires.
AnastasisKon commented 2026-11-28 12:48:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:48:05Z.


/release - done: PR #599 removes the gate in crates/victory-gpu/src/native/shaders.rs that this issue describes, and drops the memory parameter that carried it, since the page table is bound for every stage anyway. The dfafaf38/06295fb1 pair that was dropped as no_pipeline on every frame now gets a host pipeline. It is in my fork's main; the issue's open question (what the draw contributes to the picture) is still unanswered, so if that is the point, reopen the conversation rather than the claim.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7239475848 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7239475848). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T12:48:05Z. --- /release - done: PR #599 removes the gate in `crates/victory-gpu/src/native/shaders.rs` that this issue describes, and drops the `memory` parameter that carried it, since the page table is bound for every stage anyway. The `dfafaf38`/`06295fb1` pair that was dropped as `no_pipeline` on every frame now gets a host pipeline. It is in my fork's `main`; the issue's open question (what the draw contributes to the picture) is still unanswered, so if that is the point, reopen the conversation rather than the claim.
github-actions[bot] commented 2026-11-28 12:48:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T12:48:14Z.


Released. This issue is free to claim.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7239477649 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/303#issuecomment-7239477649). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T12:48:14Z. --- Released. This issue is free to claim.
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
LakshanSivakumar/Native-Victory-macOS#303
No description provided.