darner-gpu: pin the HDR present-plane order #608

Open
qnjk wants to merge 1 commit from qnjk/Darner:queue-plane-order-test into Main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: nothing. This is a tests-only change (no production line is edited).

  • What it pins: plane_order (crates/darner-gpu/src/queue.rs, fn plane_order(parameters: *const Plane, planes: u32) -> [usize; 2]) decides the order in which the two HDR present planes are composited — scene first, interface second, unless only the second plane is HDR — from the two planes' colour spaces plus a cached last answer. It is pure and had no test at all, and a wrong answer swaps an overlay under the scene or reports the wrong plane as HDR, which is exactly the kind of fault a screenshot review calls "colours are off" without pointing here.

  • This change adds one test that pins the ordering for the shapes the caller can pass: fewer than two planes, two planes whose colour spaces differ, both matching, and the cached-repeat path.

How it was tested

  • Tested revision: cf15357 (one commit on c8258f9).
  • Commands and results:
    • cargo test --locked -p darner-gpu --lib -- queue — 64 passed, 0 failed.
    • cargo clippy --locked -p darner-gpu --all-targets -- -D warnings passes.
    • Fail-before (mutating the code under test, reverted with file copies, never git stash):
      1. returning [0, 1] unconditionally:
        present_planes_are_ordered_scene_then_interface ... FAILED
        panicked at queue.rs:2079: left: [0, 1] right: [1, 0]
        
      2. dropping the "only the second plane is HDR" guard: the same test fails with left: [1, 0] right: [0, 1].
  • Changes a default: no. Tests only.
  • A/B result: not applicable — tests-only change.
  • Gates run on that revision:
    • Gate 1, cargo clippy --workspace --all-targets --locked -- -D warnings: passes.
    • Gate 2, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.
    • Gate 3, cargo test --workspace --locked: not run to completion here; the pre-existing darner-gpu test deadlock (#224) and darner-shader waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. The crate's queue tests pass.
  • Gameplay, when relevant: not applicable — tests-only change.
  • Shader wave sizes tested, when relevant: not applicable.
  • Hardware dependence: none.
  • Coverage gaps: the test builds the plane array and passes a pointer to it; a real swap chain's planes are not exercised, and the cached-repeat path is checked only for not changing a settled answer.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
    • Not applicable: tests-only change, stated at the top.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md (cargo xtask policy: 576 files ok).
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #530, #561, #565 and #80 change crates/darner-gpu/src/queue.rs; this change only adds a test block. No open or closed issue mentions plane_order.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: nothing. This is a **tests-only** change (no production line is edited). - What it pins: `plane_order` (`crates/darner-gpu/src/queue.rs`, `fn plane_order(parameters: *const Plane, planes: u32) -> [usize; 2]`) decides the order in which the two HDR present planes are composited — scene first, interface second, unless only the second plane is HDR — from the two planes' colour spaces plus a cached last answer. It is pure and had no test at all, and a wrong answer swaps an overlay under the scene or reports the wrong plane as HDR, which is exactly the kind of fault a screenshot review calls "colours are off" without pointing here. - This change adds one test that pins the ordering for the shapes the caller can pass: fewer than two planes, two planes whose colour spaces differ, both matching, and the cached-repeat path. ## How it was tested - Tested revision: `cf15357` (one commit on `c8258f9`). - Commands and results: - `cargo test --locked -p darner-gpu --lib -- queue` — 64 passed, 0 failed. - `cargo clippy --locked -p darner-gpu --all-targets -- -D warnings` passes. - Fail-before (mutating the code under test, reverted with file copies, never `git stash`): 1. returning `[0, 1]` unconditionally: ``` present_planes_are_ordered_scene_then_interface ... FAILED panicked at queue.rs:2079: left: [0, 1] right: [1, 0] ``` 2. dropping the "only the second plane is HDR" guard: the same test fails with `left: [1, 0] right: [0, 1]`. - Changes a default: no. Tests only. - A/B result: not applicable — tests-only change. - Gates run on that revision: - Gate 1, `cargo clippy --workspace --all-targets --locked -- -D warnings`: passes. - Gate 2, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passes. - Gate 3, `cargo test --workspace --locked`: not run to completion here; the pre-existing `darner-gpu` test deadlock (#224) and `darner-shader` waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. The crate's `queue` tests pass. - Gameplay, when relevant: not applicable — tests-only change. - Shader wave sizes tested, when relevant: not applicable. - Hardware dependence: none. - Coverage gaps: the test builds the plane array and passes a pointer to it; a real swap chain's planes are not exercised, and the cached-repeat path is checked only for not changing a settled answer. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - Not applicable: tests-only change, stated at the top. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md` (`cargo xtask policy`: 576 files ok). - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #530, #561, #565 and #80 change `crates/darner-gpu/src/queue.rs`; this change only adds a test block. No open or closed issue mentions `plane_order`. - Replaces or overlaps: none found
`plane_order` decides which of the title's two present planes is the scene and
which the interface: the pair is swapped only when the second plane's colour
space is HDR (PQ 12, scRGB 1) and the first's is not. Its result feeds
`placements`, `plane_resource` and the shown colour space, so a regression that
flipped the pair, or that dropped the first-plane guard so a title passing the
scene first is swapped too, would show the SDR interface over the HDR scene and
leave the suite green: nothing exercised the rule.

The new test builds the two `RetailPlane`s as the title presents them and pins
the swap, its absence when the title passes the scene first and when both or
neither plane is HDR, the values that do and do not count as HDR, a carrier with
fewer than two planes (read nowhere), planes past the second, and the logged
cache's repeat: the answer follows the spaces, not the history.
TrustNo1 changed title from [pr-tests][rendering] darner-gpu: pin the HDR present-plane order to darner-gpu: pin the HDR present-plane order 2026-12-06 03:26:20 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'queue-plane-order-test:qnjk-queue-plane-order-test'
git switch 'qnjk-queue-plane-order-test'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'qnjk-queue-plane-order-test'
git switch 'qnjk-queue-plane-order-test'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'qnjk-queue-plane-order-test'
git switch 'qnjk-queue-plane-order-test'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'qnjk-queue-plane-order-test'
git switch 'Main'
git merge --squash 'qnjk-queue-plane-order-test'
git switch 'Main'
git merge --ff-only 'qnjk-queue-plane-order-test'
git switch 'Main'
git merge 'qnjk-queue-plane-order-test'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
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
TrustNo1/Darner!608
No description provided.