d3d12: take barycentrics at the centroid on a host that refuses them at the centre #3239

Closed
github-bot wants to merge 3 commits from github-bot/gh-3239 into main AGit
Owner

@⁠personne3443 on GitHub · 2026-12-02 21:57 UTC · original
personne3443:fix/pipelines-refusees → main · +227 −5 · 7 files · 3 commits · closed without merging

Claimed in the coordination issue as: D3D12-BARYCENTRICS-CENTROID

What and why

On an RTX 5080 (NVIDIA 621.40 and 621.47, Windows 11 Insider build 26300) CreateGraphicsPipelineState fails with
E_OUTOFMEMORY for any pixel shader declaring SV_Barycentrics with a centre or sample mode, so those draws never
have a host pipeline. It also happens with hand-written HLSL compiled by DXC (ps_6_6):

float4 main(float4 a : TEXCOORD0, float4 p : SV_Position, float3 b : SV_Barycentrics) : SV_Target {
    return float4(b, 1);
}

noperspective is refused too. centroid and noperspective centroid are accepted, as is GetAttributeAtVertex
alone. EvaluateAttributeSnapped on a centroid declaration is refused. WARP and the machine's AMD iGPU make the centre
modes. I have only this machine; I found no other report of it.

The host is probed with up to two small pipelines built by the translator's emitter. Only where the centre one is refused and
the centroid one is made does the translator declare the centroid mode of the same perspective; the setting is part of
the cache key. Other hosts keep the centre modes.

Limitation (shortcut:): the same value on covered pixels with one sample a pixel. On multisampled targets or a forced
sample count, edge pixels and their derivatives differ, and a program declared per sample may run per pixel. Not
measured. leonida translate's offline pipeline checks do not run the probe.

Related: #2581 (closed) covered GPUs without barycentrics at all, a different case.

Tested

  • Red/green on the RTX 5080: first_half_values_render_on_hardware_and_warp fails on main (8d82a34ae) with the
    error above and passes here. scripts/red_green.py reports "red does not build" because the new tests call new
    functions, so this was run by hand. CI runs on WARP, where that test passes either way.
  • New tests: the mode mapping, the emitted PSV0 mode, and the probe (validator, and WARP making both modes).
  • cargo test --workspace --exclude xtask --locked: 1727 passed, 0 failed. Replay test passes.
  • scripts/check_no_game_data.py and tests/test_docs_*.py pass.
  • The counts above are from before the last rebase. After rebasing onto f3865cae8: leonida-gpu 703 passed, 0 failed, the
    barycentric tests pass; the leonida-lua tests do not compile (no method named unwrap found for struct Runtime),
    a crate this branch does not touch.
  • Replaying the known pipelines (leonida warm, measured before the rebase and the review follow-up): without a host
    pipeline 10146 of 83584 before, 7 after (compute programs that do not translate), none lost. Mesh pipelines are
    covered by this replay only. Not checked in game.

GPUs tested: NVIDIA RTX 5080 16 GB, 621.40 (before the fix) and 621.47, Windows 11 Insider 26300; AMD Radeon
integrated, 32.0.21042.62 (accepts the centre modes); WARP.

AI-assisted: yes (Claude Code). The code was written by Claude Sonnet 5.5, below the tier CONTRIBUTING.md lists for
new code. It was reviewed read-only, twice, by Claude Opus 5.5: the findings on the probe's tests, its place before the
recording, test-only code, formatting and the limitation's wording were addressed; the offline leonida translate gap
is disclosed above; the optional suggestions on probe logging and the doc row's placement were not taken.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🤖 Generated with Claude Code

**@⁠personne3443** on GitHub · 2026-12-02 21:57 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3239) `personne3443:fix/pipelines-refusees` → `main` · +227 −5 · 7 files · 3 commits · closed without merging Claimed in the coordination issue as: D3D12-BARYCENTRICS-CENTROID ### What and why On an RTX 5080 (NVIDIA 621.40 and 621.47, Windows 11 Insider build 26300) `CreateGraphicsPipelineState` fails with `E_OUTOFMEMORY` for any pixel shader declaring `SV_Barycentrics` with a centre or sample mode, so those draws never have a host pipeline. It also happens with hand-written HLSL compiled by DXC (`ps_6_6`): ```hlsl float4 main(float4 a : TEXCOORD0, float4 p : SV_Position, float3 b : SV_Barycentrics) : SV_Target { return float4(b, 1); } ``` `noperspective` is refused too. `centroid` and `noperspective centroid` are accepted, as is `GetAttributeAtVertex` alone. `EvaluateAttributeSnapped` on a centroid declaration is refused. WARP and the machine's AMD iGPU make the centre modes. I have only this machine; I found no other report of it. The host is probed with up to two small pipelines built by the translator's emitter. Only where the centre one is refused and the centroid one is made does the translator declare the centroid mode of the same perspective; the setting is part of the cache key. Other hosts keep the centre modes. Limitation (`shortcut:`): the same value on covered pixels with one sample a pixel. On multisampled targets or a forced sample count, edge pixels and their derivatives differ, and a program declared per sample may run per pixel. Not measured. `leonida translate`'s offline pipeline checks do not run the probe. Related: #2581 (closed) covered GPUs without barycentrics at all, a different case. ### Tested - Red/green on the RTX 5080: `first_half_values_render_on_hardware_and_warp` fails on `main` (8d82a34ae) with the error above and passes here. `scripts/red_green.py` reports "red does not build" because the new tests call new functions, so this was run by hand. CI runs on WARP, where that test passes either way. - New tests: the mode mapping, the emitted `PSV0` mode, and the probe (validator, and WARP making both modes). - `cargo test --workspace --exclude xtask --locked`: 1727 passed, 0 failed. Replay test passes. - `scripts/check_no_game_data.py` and `tests/test_docs_*.py` pass. - The counts above are from before the last rebase. After rebasing onto `f3865cae8`: `leonida-gpu` 703 passed, 0 failed, the barycentric tests pass; the `leonida-lua` tests do not compile (`no method named unwrap found for struct Runtime`), a crate this branch does not touch. - Replaying the known pipelines (`leonida warm`, measured before the rebase and the review follow-up): without a host pipeline 10146 of 83584 before, 7 after (compute programs that do not translate), none lost. Mesh pipelines are covered by this replay only. Not checked in game. GPUs tested: NVIDIA RTX 5080 16 GB, 621.40 (before the fix) and 621.47, Windows 11 Insider 26300; AMD Radeon integrated, 32.0.21042.62 (accepts the centre modes); WARP. AI-assisted: yes (Claude Code). The code was written by Claude Sonnet 5.5, below the tier CONTRIBUTING.md lists for new code. It was reviewed read-only, twice, by Claude Opus 5.5: the findings on the probe's tests, its place before the recording, test-only code, formatting and the limitation's wording were addressed; the offline `leonida translate` gap is disclosed above; the optional suggestions on probe logging and the doc row's placement were not taken. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
An RTX 5080 (NVIDIA 621.40 and 621.47) fails pipeline creation with
E_OUTOFMEMORY for a pixel shader declaring SV_Barycentrics at the pixel
centre. The host is probed; where only the centroid mode is made, the
translator declares it, and the setting is part of the cache key.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Review follow-up: the probe's programs pass the validator and WARP makes
both modes; the emitted PSV0 mode is asserted; the multisampling limit is
stated in full.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 22:03:49 +00:00
github-bot closed this pull request 2026-12-02 23:11:12 +00:00
Author
Owner

@⁠personne3443 on GitHub · 2026-12-02 23:06 UTC · original

Closing: the cause was misdiagnosed. The refusal came from anti-aliasing overrides in this machine's NVIDIA global
profile (FXAA on, antialiasing mode/setting and transparency supersampling overridden). With those four settings back
to their defaults, first_half_values_render_on_hardware_and_warp passes on unpatched main (8d82a34ae) on the same
RTX 5080 (621.47), and an unpatched Foxhound 0.8.2 renders the missing objects with no refused pipeline in its log.
This change is not needed. Which of the four settings triggers it was not isolated. AI-assisted.

**@⁠personne3443** on GitHub · 2026-12-02 23:06 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3239#issuecomment-7361576226) Closing: the cause was misdiagnosed. The refusal came from anti-aliasing overrides in this machine's NVIDIA global profile (FXAA on, antialiasing mode/setting and transparency supersampling overridden). With those four settings back to their defaults, first_half_values_render_on_hardware_and_warp passes on unpatched main (8d82a34ae) on the same RTX 5080 (621.47), and an unpatched Foxhound 0.8.2 renders the missing objects with no refused pipeline in its log. This change is not needed. Which of the four settings triggers it was not isolated. AI-assisted.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!3239
No description provided.