darner rig: the per-start list follows the switch, and an unreadable settings file is an error #610

Open
qnjk wants to merge 1 commit from qnjk/Darner:rig-report-truth into Main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: darner rig's report said two things that were not true (apps/darner/src/rig.rs):

    1. It listed the per-start switches (rig::per_start's picks, e.g. DARNER_PIPELINE_WORKERS) unconditionally, with the hint "DARNER_AUTO_SWITCHES=0 turns them off" — backwards: the auto switches are off unless DARNER_AUTO_SWITCHES=1, and darner play does not set them at all in that state, so the report showed choices the launcher would not make.
    2. When the settings file could not be read (for example a directory sitting at darner-settings.txt), every row was printed as "not set" — a claim about the machine, where the truth was "could not read the settings".
  • This change splits the report into two helpers: settings_lines propagates a settings-read error naming the file (as base_once already does for the same file elsewhere), and per_start_lines prints the per-start picks only when the settings file has DARNER_AUTO_SWITCHES=1, otherwise says they are off and how to turn them on — and keeps the "none for this PC" answer for the on-but-no-pick case. The backwards hint is gone with it.

How it was tested

  • Tested revision: 3102776 (one commit on c8258f9).
  • Commands and results:
    • cargo test --locked -p darner — 210 passed, 1 ignored, plus the crate's 2 + 2 + 8 integration tests.
    • Two new tests: rig::tests::per_start_is_off_unless_the_switch_is_one and rig::tests::a_settings_file_that_cannot_be_read_is_an_error.
    • Fail-before, with the old bodies restored:
      rig::tests:: (5 tests) ... test result: FAILED. 3 passed; 2 failed
      panicked: says how they are turned on: ["per start (... DARNER_AUTO_SWITCHES=0 turns them off):", ...]
      panicked: called `Result::unwrap_err()` on an `Ok` value: []
      
    • End to end with the debug binary: an empty home prints the "off" line; a home with DARNER_AUTO_SWITCHES=1 prints DARNER_PIPELINE_WORKERS=4; a directory at darner-settings.txt exits 1 with Error: reading ….
    • cargo clippy --locked -p darner --all-targets -- -D warnings passes.
  • Changes a default: no. Nothing the launcher does changes; only what the report says about it.
  • A/B result: not applicable — no default changes and no speed claim.
  • 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. darner's suite is green.
  • Gameplay, when relevant: no gameplay run; this is the offline rig report.
  • Shader wave sizes tested, when relevant: not applicable.
  • Hardware dependence: none.
  • Coverage gaps: the report was checked with three settings states (missing file, switch off, switch on); a settings file that parses but has an unreadable key is not exercised.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
    • Not applicable: darner rig is an offline report, and the change cannot alter what a run does.
  • 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: none found. No open pull request changes apps/darner/src/rig.rs (checked against the file list of all 189 open pull requests), and no open or closed issue mentions the rig report.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: `darner rig`'s report said two things that were not true (apps/darner/src/rig.rs): 1. It listed the **per-start** switches (`rig::per_start`'s picks, e.g. `DARNER_PIPELINE_WORKERS`) unconditionally, with the hint "`DARNER_AUTO_SWITCHES=0` turns them off" — backwards: the auto switches are **off** unless `DARNER_AUTO_SWITCHES=1`, and `darner play` does not set them at all in that state, so the report showed choices the launcher would not make. 2. When the settings file could not be read (for example a directory sitting at `darner-settings.txt`), every row was printed as "not set" — a claim about the machine, where the truth was "could not read the settings". - This change splits the report into two helpers: `settings_lines` propagates a settings-read error naming the file (as `base_once` already does for the same file elsewhere), and `per_start_lines` prints the per-start picks only when the settings file has `DARNER_AUTO_SWITCHES=1`, otherwise says they are off and how to turn them on — and keeps the "none for this PC" answer for the on-but-no-pick case. The backwards hint is gone with it. ## How it was tested - Tested revision: `3102776` (one commit on `c8258f9`). - Commands and results: - `cargo test --locked -p darner` — 210 passed, 1 ignored, plus the crate's 2 + 2 + 8 integration tests. - Two new tests: `rig::tests::per_start_is_off_unless_the_switch_is_one` and `rig::tests::a_settings_file_that_cannot_be_read_is_an_error`. - Fail-before, with the old bodies restored: ``` rig::tests:: (5 tests) ... test result: FAILED. 3 passed; 2 failed panicked: says how they are turned on: ["per start (... DARNER_AUTO_SWITCHES=0 turns them off):", ...] panicked: called `Result::unwrap_err()` on an `Ok` value: [] ``` - End to end with the debug binary: an empty home prints the "off" line; a home with `DARNER_AUTO_SWITCHES=1` prints `DARNER_PIPELINE_WORKERS=4`; a directory at `darner-settings.txt` exits 1 with `Error: reading …`. - `cargo clippy --locked -p darner --all-targets -- -D warnings` passes. - Changes a default: no. Nothing the launcher does changes; only what the report says about it. - A/B result: not applicable — no default changes and no speed claim. - 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. `darner`'s suite is green. - Gameplay, when relevant: no gameplay run; this is the offline `rig` report. - Shader wave sizes tested, when relevant: not applicable. - Hardware dependence: none. - Coverage gaps: the report was checked with three settings states (missing file, switch off, switch on); a settings file that parses but has an unreadable key is not exercised. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - Not applicable: `darner rig` is an offline report, and the change cannot alter what a run does. - [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: none found. No open pull request changes `apps/darner/src/rig.rs` (checked against the file list of all 189 open pull requests), and no open or closed issue mentions the rig report. - Replaces or overlaps: none found
`darner rig` printed "per start (... DARNER_AUTO_SWITCHES=0 turns them off)" and
then always listed `rig::per_start`'s picks, but `darner play` adds them only when
that switch is explicitly 1 (`auto_switches` returns before the picks otherwise,
play.rs's "off by default"). On a default install — no `DARNER_AUTO_SWITCHES` line
anywhere, the normal state — the report named switches the next start would not
set, and the hint had the polarity backwards: `=0` does not turn them off, they
are off unless `=1`. The section is now built by `per_start_lines`, which prints
the picks only with `DARNER_AUTO_SWITCHES=1` in the settings file (a start's
`--set` counts too and is not known here) and otherwise says they are off and how
they are turned on, so "none for this PC" is left to mean a PC that has no pick.

The same report read the settings file with `unwrap_or_default()`, so a file that
was there and could not be read (a sharing violation, an ACL deny, a directory at
its path) became an empty list and every row printed "now not set" — a claim that
the player had set nothing, where nothing had been read. `settings_lines` now
propagates the error with the file's name, as `base_once`'s own read already does,
so the command fails with `Error: reading ...` and exit 1 instead of reporting a
machine it did not see.

Tests: `per_start_is_off_unless_the_switch_is_one` (no line and a saved 0 list no
pick and say how to turn them on; 1 lists play-rig's row; on with no pick keeps
"none for this PC") and `a_settings_file_that_cannot_be_read_is_an_error` (a
directory at the settings path is an error naming the read and the file).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
TrustNo1 changed title from [pr-fix] darner rig: the per-start list follows the switch, and an unreadable settings file is an error to darner rig: the per-start list follows the switch, and an unreadable settings file is an error 2026-12-06 03:26:18 +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 'rig-report-truth:qnjk-rig-report-truth'
git switch 'qnjk-rig-report-truth'

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-rig-report-truth'
git switch 'qnjk-rig-report-truth'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'qnjk-rig-report-truth'
git switch 'qnjk-rig-report-truth'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'qnjk-rig-report-truth'
git switch 'Main'
git merge --squash 'qnjk-rig-report-truth'
git switch 'Main'
git merge --ff-only 'qnjk-rig-report-truth'
git switch 'Main'
git merge 'qnjk-rig-report-truth'
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!610
No description provided.