[pr-docs][startup] Add docs/testing-prs.md: build and test a pull request without having built Darner before #203

Manually merged
TrustNo1 merged 3 commits from Jesper-A/Darner:up-docs-testing-prs into main 2026-12-04 22:18:00 +00:00
Collaborator

Related: #167 asks whether dev builds should have one way in; the page names today's scripts\play-nvidia.ps1 and will follow if that changes.

What it changes

  • The problem on main: read from the repository only. There is no page that tells a player who has never built Darner how to try a pull request. CONTRIBUTING.md says testing someone else's pull request is the most useful thing to do, but gives no steps.

Adds docs/testing-prs.md, a copy-and-paste guide, and one sentence in CONTRIBUTING.md that links to it. It covers:

  • winget installs of Git, Rustup and the Visual Studio 2022 Build Tools with the C++ workload (Microsoft.VisualStudio.Workload.VCTools, with --includeRecommended, and --wait --passive because --override replaces winget's own installer arguments);
  • a fresh clone per pull request, git fetch origin refs/pull/<N>/head, then git checkout <the verified 40-character commit>;
  • Get-NVIDIA-DLSS.cmd, then scripts\play-nvidia.ps1 -Exe ... -More '<SWITCH>';
  • a note for AMD and Intel cards (skip the DLSS download, add -Dlss off);
  • what to report, and which log to attach.

Why a pinned commit and a build, not a downloaded exe: testers build a commit that someone checked first, named by its full hash. A pull request can be changed after it was checked, and a downloaded exe from an unchecked pull request could be malicious. If the pull request moved, git checkout fails with "reference is not a tree" and the page tells the tester to wait. This came out of a Fluxer discussion on 2026-12-04 with xrobau and TrustNo1. The Fluxer bot will post a thread per pull request that fills in N, the commit and the switch, and links to this page.

How it was tested

  • Tested revision: the commit of this branch (up-docs-testing-prs, based on trustno1/main f3840d73d).
  • Commands and results: no code changed, so no cargo gate was run. Of the three gates in AGENTS.md (cargo clippy --workspace --all-targets --locked -- -D warnings, the same with --all-features, cargo test --workspace --locked) none applies to a docs-only diff and none was run. cargo xtask policy: not run. The facts the page states were checked against trustno1/main by reading scripts/play-nvidia.ps1, rust-toolchain.toml and Get-NVIDIA-DLSS.cmd.
  • The install lines were tried on a fresh Windows install (2026-12-04).
  • Changes a default: no.
  • A/B result: not applicable (docs only).
  • Gameplay, when relevant: not run. The play-nvidia.ps1 line with -More was not run end to end from a fresh clone of the final page.
  • Shader wave sizes tested: not applicable.
  • Hardware dependence: likely general for the Windows steps. The AMD and Intel note is untested elsewhere.
  • Coverage gaps:
    • AMD and Intel: not tried in practice. The note comes from reading play-nvidia.ps1: without the NVIDIA files it prints launcher.sdk.nvidia_missing and plays on, and -Dlss off skips the check.
    • If #167's rework lands (xrobau's branch has scripts/build-darner.ps1 and play.ps1), the page follows the new names.

Spec dependence

Likely general: the page is about Windows tools and git. The play line was read for an NVIDIA card; AMD and Intel are untested. Nothing here depends on the author's hardware (RTX 2070 SUPER, ReBAR off).

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only). Docs only: nothing in the game changes.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md. No game data, names or screenshots.
  • 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: #180 (README header and "tester guide"; touches README.md only, no install or refs/pull steps), #152 (docs/ab-testing.md). Related issue: #167 (question about launcher names).
  • Replaces or overlaps: none found.

This change was made with AI assistance (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. --> Related: #167 asks whether dev builds should have one way in; the page names today's `scripts\play-nvidia.ps1` and will follow if that changes. ## What it changes - The problem on main: read from the repository only. There is no page that tells a player who has never built Darner how to try a pull request. `CONTRIBUTING.md` says testing someone else's pull request is the most useful thing to do, but gives no steps. Adds `docs/testing-prs.md`, a copy-and-paste guide, and one sentence in `CONTRIBUTING.md` that links to it. It covers: - `winget` installs of Git, Rustup and the Visual Studio 2022 Build Tools with the C++ workload (`Microsoft.VisualStudio.Workload.VCTools`, with `--includeRecommended`, and `--wait --passive` because `--override` replaces winget's own installer arguments); - a fresh clone per pull request, `git fetch origin refs/pull/<N>/head`, then `git checkout <the verified 40-character commit>`; - `Get-NVIDIA-DLSS.cmd`, then `scripts\play-nvidia.ps1 -Exe ... -More '<SWITCH>'`; - a note for AMD and Intel cards (skip the DLSS download, add `-Dlss off`); - what to report, and which log to attach. Why a pinned commit and a build, not a downloaded exe: testers build a commit that someone checked first, named by its full hash. A pull request can be changed after it was checked, and a downloaded exe from an unchecked pull request could be malicious. If the pull request moved, `git checkout` fails with "reference is not a tree" and the page tells the tester to wait. This came out of a Fluxer discussion on 2026-12-04 with xrobau and TrustNo1. The Fluxer bot will post a thread per pull request that fills in N, the commit and the switch, and links to this page. ## How it was tested - Tested revision: the commit of this branch (`up-docs-testing-prs`, based on `trustno1/main` f3840d73d). - Commands and results: no code changed, so no cargo gate was run. Of the three gates in AGENTS.md (`cargo clippy --workspace --all-targets --locked -- -D warnings`, the same with `--all-features`, `cargo test --workspace --locked`) none applies to a docs-only diff and none was run. `cargo xtask policy`: not run. The facts the page states were checked against `trustno1/main` by reading `scripts/play-nvidia.ps1`, `rust-toolchain.toml` and `Get-NVIDIA-DLSS.cmd`. - The install lines were tried on a fresh Windows install (2026-12-04). - Changes a default: no. - A/B result: not applicable (docs only). - Gameplay, when relevant: not run. The `play-nvidia.ps1` line with `-More` was not run end to end from a fresh clone of the final page. - Shader wave sizes tested: not applicable. - Hardware dependence: likely general for the Windows steps. The AMD and Intel note is untested elsewhere. - Coverage gaps: - AMD and Intel: not tried in practice. The note comes from reading `play-nvidia.ps1`: without the NVIDIA files it prints `launcher.sdk.nvidia_missing` and plays on, and `-Dlss off` skips the check. - If #167's rework lands (xrobau's branch has `scripts/build-darner.ps1` and `play.ps1`), the page follows the new names. ## Spec dependence Likely general: the page is about Windows tools and git. The play line was read for an NVIDIA card; AMD and Intel are untested. Nothing here depends on the author's hardware (RTX 2070 SUPER, ReBAR off). ## Checklist - [ ] I ran this change in the game, or say below why it can't be (docs, tests only). Docs only: nothing in the game changes. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. No game data, names or screenshots. - [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: #180 (README header and "tester guide"; touches `README.md` only, no install or `refs/pull` steps), #152 (`docs/ab-testing.md`). Related issue: #167 (question about launcher names). - Replaces or overlaps: none found. This change was made with AI assistance (Claude Code).
A page for players who have never built Darner: install the tools with
winget, fetch the pull request's verified commit through refs/pull/<N>/head,
build and play it with scripts\play-nvidia.ps1 and the change's switch in
-More, and report. CONTRIBUTING.md points to it.

This change was made with AI assistance (Claude Code).
Contributor

I tested the section 2 copy-and-paste block at 4d6960aaa178 with Windows PowerShell 5.1 and Git 2.53.0.windows.1, using a local two-commit repository and a print marker in place of the downloader. With a valid pin, the marker ran on the intended commit. With an unknown pin, git checkout exited 128, but the marker still ran on the default commit. A failed clone into an existing directory also continued to the next line.

Please put the sequence in a single & { … } block that checks $LASTEXITCODE after each Git command, uses Set-Location -ErrorAction Stop, and verifies that git rev-parse --verify HEAD succeeds and equals the full pin before the downloader runs. In the same fixture this preserved the successful case and stopped all three failure cases (unknown pin, existing non-repository directory, existing clone). No SDK or game was run.

I tested the section 2 copy-and-paste block at `4d6960aaa178` with Windows PowerShell 5.1 and Git 2.53.0.windows.1, using a local two-commit repository and a print marker in place of the downloader. With a valid pin, the marker ran on the intended commit. With an unknown pin, `git checkout` exited 128, but the marker still ran on the default commit. A failed clone into an existing directory also continued to the next line. Please put the sequence in a single `& { … }` block that checks `$LASTEXITCODE` after each Git command, uses `Set-Location -ErrorAction Stop`, and verifies that `git rev-parse --verify HEAD` succeeds and equals the full pin before the downloader runs. In the same fixture this preserved the successful case and stopped all three failure cases (unknown pin, existing non-repository directory, existing clone). No SDK or game was run.
Pasted as separate lines, PowerShell ran every line even after git clone
or git checkout failed, so the downloader ran on the wrong commit (review
on #203). Step 2 is now one block that checks each git command, enters the
folder with -ErrorAction Stop and compares HEAD with the verified commit
before anything else runs. Tried in Windows PowerShell 5.1 and PowerShell 7
against a local repository with a pull ref: a valid commit, an unknown
commit, an existing folder and an existing clone.

The Build Tools line also passes --norestart, so the installer never asks
for a restart halfway through the first-time setup.

This change was made with AI assistance (Claude Code).
Author
Collaborator

Thanks for testing this, and for the fixture. You were right: the line-by-line paste carried on after a failed clone or checkout.

Fixed in 2a01b3b78. Section 2 is now one & { } block that:

  • checks $LASTEXITCODE after clone, fetch and checkout;
  • uses cd ... -ErrorAction Stop;
  • compares (git rev-parse HEAD) with the pinned commit before Get-NVIDIA-DLSS.cmd runs;
  • prints a "Stopped: ..." line saying why it stopped.

One difference from your suggestion: I used git rev-parse HEAD without --verify. After a checkout a detached HEAD always resolves, so the comparison checks the same thing.

I ran it in a local fixture repository with a pull ref, with the downloader replaced by an echo. Windows PowerShell 5.1:

  • valid pin: the downloader ran on the PR commit;
  • unknown pin: "Stopped: the PR changed..." printed, downloader did not run;
  • existing non-repository folder, and existing clone: "Stopped: clone failed...", downloader did not run.

PowerShell 7: the valid and unknown-pin cases behave the same. No SDK or game was run.

The same commit also adds --norestart to the Build Tools line, so the installer doesn't ask for a restart during setup.

This comment was written with AI assistance (Claude Code).

Thanks for testing this, and for the fixture. You were right: the line-by-line paste carried on after a failed clone or checkout. Fixed in 2a01b3b78. Section 2 is now one `& { }` block that: - checks `$LASTEXITCODE` after clone, fetch and checkout; - uses `cd ... -ErrorAction Stop`; - compares `(git rev-parse HEAD)` with the pinned commit before `Get-NVIDIA-DLSS.cmd` runs; - prints a "Stopped: ..." line saying why it stopped. One difference from your suggestion: I used `git rev-parse HEAD` without `--verify`. After a checkout a detached HEAD always resolves, so the comparison checks the same thing. I ran it in a local fixture repository with a pull ref, with the downloader replaced by an echo. Windows PowerShell 5.1: - valid pin: the downloader ran on the PR commit; - unknown pin: "Stopped: the PR changed..." printed, downloader did not run; - existing non-repository folder, and existing clone: "Stopped: clone failed...", downloader did not run. PowerShell 7: the valid and unknown-pin cases behave the same. No SDK or game was run. The same commit also adds `--norestart` to the Build Tools line, so the installer doesn't ask for a restart during setup. This comment was written with AI assistance (Claude Code).
Jesper-A changed title from WIP: [pr-docs][startup] Add docs/testing-prs.md: build and test a pull request without having built Darner before to [pr-docs][startup] Add docs/testing-prs.md: build and test a pull request without having built Darner before 2026-12-04 05:43:20 +00:00
Owner

Review of 2a01b3b7 (read only):

  • The new step 2 block is right. It checks $LASTEXITCODE after clone, fetch and checkout, compares HEAD with the pinned commit, and return stops the block. cd inside & { } still moves the window's location, so step 3 runs in the clone as intended.

  • One blocker is still open: the last line says the player's own Darner folder and settings are not changed. They are. scripts\play-nvidia.ps1 uses DARNER_HOME, which defaults to %LOCALAPPDATA%\darner, the same folder as the released darner.exe (settings, logs, shader and pipeline caches). A PR build with another translator starts a new pipeline library there and replaces the player's (main 34b0ba77), so their next normal start compiles everything again. Please add, before the play line in step 3:

    $env:DARNER_HOME = "$PWD\test-home"
    

    and say that the first start there compiles shaders (stutter, or run a preload). Then the last line is true.

  • Small: -Build defaults to fast, which isn't fully optimised. For fps comparisons, use -Build release on both runs or say both used the same build.

Ready to merge once the DARNER_HOME line is in.

Review of 2a01b3b7 (read only): - The new step 2 block is right. It checks `$LASTEXITCODE` after clone, fetch and checkout, compares `HEAD` with the pinned commit, and `return` stops the block. `cd` inside `& { }` still moves the window's location, so step 3 runs in the clone as intended. - **One blocker is still open:** the last line says the player's own Darner folder and settings are not changed. They are. `scripts\play-nvidia.ps1` uses `DARNER_HOME`, which defaults to `%LOCALAPPDATA%\darner`, the same folder as the released darner.exe (settings, logs, shader and pipeline caches). A PR build with another translator starts a new pipeline library there and replaces the player's (main 34b0ba77), so their next normal start compiles everything again. Please add, before the play line in step 3: ```powershell $env:DARNER_HOME = "$PWD\test-home" ``` and say that the first start there compiles shaders (stutter, or run a preload). Then the last line is true. - Small: `-Build` defaults to `fast`, which isn't fully optimised. For fps comparisons, use `-Build release` on both runs or say both used the same build. Ready to merge once the `DARNER_HOME` line is in.
play-nvidia.ps1 uses DARNER_HOME, which defaults to the same folder as the
released darner.exe, so a PR build replaced the player's pipeline library
and settings (review on #203). Step 3 now sets DARNER_HOME to a test-home
folder in the clone before the play line, says the first start there
compiles shaders, and points to the log there. It also says the default
fast build is not fully optimised: use -Build release on both runs for an
fps comparison, or say both used the same build.

This change was made with AI assistance (Claude Code).
Author
Collaborator

Thanks. Fixed in cdb6920bf:

  • Step 3 now sets $env:DARNER_HOME = "$PWD\test-home" on the line before the play line, so the settings, logs and caches go to a test-home folder in the clone. It says the first start there compiles shaders (stutter, or let the preload run), and that the variable has to be set again in a new window.
  • The log path in step 4 now points to test-home\logs\, and the last line says the player's own folder is unchanged with DARNER_HOME set.
  • For fps comparisons it says the default fast build is not fully optimised: use -Build release on both runs, or say both used the same build.

Not run: no build or game start with the new line; only the text changed.

This comment was written with AI assistance (Claude Code).

Thanks. Fixed in cdb6920bf: - Step 3 now sets `$env:DARNER_HOME = "$PWD\test-home"` on the line before the play line, so the settings, logs and caches go to a `test-home` folder in the clone. It says the first start there compiles shaders (stutter, or let the preload run), and that the variable has to be set again in a new window. - The log path in step 4 now points to `test-home\logs\`, and the last line says the player's own folder is unchanged *with* `DARNER_HOME` set. - For fps comparisons it says the default `fast` build is not fully optimised: use `-Build release` on both runs, or say both used the same build. Not run: no build or game start with the new line; only the text changed. This comment was written with AI assistance (Claude Code).
Owner

Review of cdb6920b (read only): the blocker is fixed. With $env:DARNER_HOME = "$PWD\test-home" in step 3, play-nvidia.ps1 keeps the settings, logs and caches in the clone, so the closing line is now true. The fresh-cache stutter note, the -Build release note and the new log path are all right. Nothing is left open: ready to merge.

Review of cdb6920b (read only): the blocker is fixed. With `$env:DARNER_HOME = "$PWD\test-home"` in step 3, `play-nvidia.ps1` keeps the settings, logs and caches in the clone, so the closing line is now true. The fresh-cache stutter note, the `-Build release` note and the new log path are all right. Nothing is left open: ready to merge.
TrustNo1 manually merged commit 04eee886c0 into main 2026-12-04 22:16:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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!203
No description provided.