[pr-fix][shaders] DARNER_STRICT_JOINS and DARNER_MESH_OUTPUT_STRICT are on only at 1, as the README says #422

Open
iBooM72 wants to merge 1 commit from iboom72/strict-switches-only-at-1 into main AGit
Contributor

What it changes

  • The problem on main: read from the code only. Both switches are read with .is_some() (crates/darner-shader/src/emit/lower.rs:5840 and :15033). The README documents both as 1 = on. So DARNER_STRICT_JOINS=0, typed to turn it off, turns it on: by the code's own count about 40 shaders (vehicle paint, foliage) then stop drawing. Both names are in KEYED, so the value also changes the shader cache key, and every shader is translated again.

Both now read is_some_and(|v| v == "1"), which is what asked_for! means in darner-gpu. The comment at :15027 says =1 too.

This re-keys every user's shader cache once. It is a code change in darner-shader, so DARNER_TRANSLATOR changes. Since 34b0ba77, the pipeline library another translator wrote is no longer loaded (made_by_another_build, crates/darner-gpu/src/pipeline/library.rs:695), so each user also starts an empty library. And until #264 lands, the preload's done marks are lost too (#128). It may be best merged together with another translator change, such as #303 or #304, so users pay for one re-translation instead of two.

How it was tested

  • Tested revision: c75b8c58 (on main f3840d73)
  • Commands and results:
    • cargo clippy -p darner-shader --lib --locked -- -D warnings: clean.
  • Changes a default: no. Unset stays off; only =0 and other values than 1 change, from on to off.
  • Gates run on that revision: none of the three workspace gates.
  • Gameplay: not run. Both switches are off by default and only for testing.
  • Hardware dependence: none.
  • Coverage gaps: no test sets either switch (the strict-join test in lower/tests.rs is #[ignore]).

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only). Not run: two off-by-default test switches.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • 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: issue #398 (one way to read switches in every crate; it cites these two reads), issue #128 and PR #264 (what a re-key costs). 25 open PRs change lower.rs. With git merge-tree against their current heads, none gets a conflict from this branch: #31, #32, #35, #223, #292, #295, #304, #312, #347, #394 and #408 merge cleanly, and the others already conflict with main in the same places as before.
  • Replaces or overlaps: none found

Checked with AI assistance (Claude Code).

🤖 Generated with Claude Code

<!-- Thanks for the pull request. Start the title with its type (pr-fix, pr-feature, pr-performance, pr-diagnostics, pr-refactor, pr-docs or pr-tests) and the area tags, like [pr-fix][memory]. This host has no labels yet, so the tags stay in the title. --> ## What it changes - The problem on main: read from the code only. Both switches are read with `.is_some()` (`crates/darner-shader/src/emit/lower.rs:5840` and `:15033`). The README documents both as `1 = on`. So `DARNER_STRICT_JOINS=0`, typed to turn it off, turns it on: by the code's own count about 40 shaders (vehicle paint, foliage) then stop drawing. Both names are in `KEYED`, so the value also changes the shader cache key, and every shader is translated again. Both now read `is_some_and(|v| v == "1")`, which is what `asked_for!` means in darner-gpu. The comment at `:15027` says `=1` too. **This re-keys every user's shader cache once.** It is a code change in darner-shader, so `DARNER_TRANSLATOR` changes. Since `34b0ba77`, the pipeline library another translator wrote is no longer loaded (`made_by_another_build`, `crates/darner-gpu/src/pipeline/library.rs:695`), so each user also starts an empty library. And until #264 lands, the preload's done marks are lost too (#128). It may be best merged together with another translator change, such as #303 or #304, so users pay for one re-translation instead of two. ## How it was tested - Tested revision: `c75b8c58` (on `main` `f3840d73`) - Commands and results: - `cargo clippy -p darner-shader --lib --locked -- -D warnings`: clean. - Changes a default: no. Unset stays off; only `=0` and other values than `1` change, from on to off. - Gates run on that revision: none of the three workspace gates. - Gameplay: not run. Both switches are off by default and only for testing. - Hardware dependence: none. - Coverage gaps: no test sets either switch (the strict-join test in `lower/tests.rs` is `#[ignore]`). ## Checklist - [ ] I ran this change in the game, or say below why it can't be (docs, tests only). Not run: two off-by-default test switches. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [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: issue #398 (one way to read switches in every crate; it cites these two reads), issue #128 and PR #264 (what a re-key costs). 25 open PRs change `lower.rs`. With `git merge-tree` against their current heads, none gets a conflict from this branch: #31, #32, #35, #223, #292, #295, #304, #312, #347, #394 and #408 merge cleanly, and the others already conflict with `main` in the same places as before. - Replaces or overlaps: none found Checked with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Both were read with .is_some(), so DARNER_STRICT_JOINS=0, typed to turn
it off, turned it on: about 40 shaders stop drawing, and as both names
are in the shader cache key, every shader is translated again. The README
documents both as "1 = on", which is what they now read.

This is a translator change, so it re-keys every user's shader cache once.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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 origin '+refs/pull/422/head:iboom72/strict-switches-only-at-1'
git switch 'iboom72/strict-switches-only-at-1'

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 'iboom72/strict-switches-only-at-1'
git switch 'iboom72/strict-switches-only-at-1'
git rebase 'main'
git switch 'main'
git merge --ff-only 'iboom72/strict-switches-only-at-1'
git switch 'iboom72/strict-switches-only-at-1'
git rebase 'main'
git switch 'main'
git merge --no-ff 'iboom72/strict-switches-only-at-1'
git switch 'main'
git merge --squash 'iboom72/strict-switches-only-at-1'
git switch 'main'
git merge --ff-only 'iboom72/strict-switches-only-at-1'
git switch 'main'
git merge 'iboom72/strict-switches-only-at-1'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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!422
No description provided.