[question][startup] Two preload progress windows (a PowerShell one over the title's splash, a native one): which should stay? #166

Open
opened 2026-12-04 01:09:34 +00:00 by Jesper-A · 4 comments
Contributor

What I would like to ask

There are two different windows that show the shader preload, and which one you see depends on how you start the game. Which one do you want to keep?

Read from main at 57dea7f23. Nothing was run for this question.

The two windows

1. The script window (scripts/preload-window.ps1, a Windows Forms / GDI+ window made by PowerShell)

  • Drawn over the title's own splash picture: -Splash, else SplashScreenImage in MicrosoftGame.config or xbs_splash.png beside the exe, else a plain window (Get-SplashImage, scripts/preload-window.ps1:17-50).
  • Label PRELOADING SHADERS (locales/en.json:107), three stages SHADERS / PIPELINES / LIBRARY (locales/en.json:136-138), a count, elapsed time, and a "Skip and start the game" link (en.json:128; Skip asks for confirmation, preload-window.ps1:192-199).
  • Its only caller is scripts/play-nvidia.ps1 (:86 loads it, :486 opens it when the start preloads, -NoPreloadWindow turns it off, :71). You get it with play-nvidia.ps1 -Preload, and with PLAY_FRAMEGEN.cmd and PLAY_FACES_FIX.cmd, which end in play-nvidia.ps1 (scripts/play-nvidia-framegen.ps1:232). The window is fed by the darner preload <folder> that the script starts (play-nvidia.ps1:490).

2. The native window (apps/darner/src/preload_ui.rs, drawn with GDI inside darner.exe)

  • Title "Preparing shaders" (locales/en.json:787), the step, a bar, time left, and two buttons: Play now and Quit (preload_ui.rs:1-4, :312-333). Drawn in the project's colours, no picture (preload_ui.rs:12).
  • Used by darner.exe play: the preload a first start runs by itself (apps/darner/src/main.rs:690-693, play.rs:748-749) and Play-MyRig.cmd (scripts/play-rig.ps1 starts darner play ... --preload, :517, :809).
  • It runs darner preload <folder> --all (preload_ui.rs:159-161). The script window runs darner preload <folder> without --all (play-nvidia.ps1:490), so the two preloads are not the same job. I have not traced what each one ends up making.

F1 > PRELOAD SHADERS opens whichever window belongs to the launcher that started the game. The menu restarts that launcher with DARNER_PRELOAD=1 (crates/darner-gpu/src/host/menu.rs:1264; play-nvidia.ps1 sets itself as the launcher at :374, and reads the variable at :90; darner play reads it at main.rs:674).

Play-Darner.cmd shows neither: it runs darner.exe run ... --execute (Play-Darner.cmd:44), which does not preload.

The native window arrived in a7d321b14 (2026-12-01).

One small bug in the script window (observation only)

A tester reported that the newest log line at the bottom of the script window shows raw colour codes (the [2m...[0m [32m INFO kind). Likely cause, from reading the code and not confirmed: the script only cuts the time and level off a line with the pattern ^\S+Z\s+(TRACE|DEBUG|INFO|WARN|ERROR)\s+ (preload-window.ps1:418) and never strips colour codes (no code for it anywhere under scripts/), while the console log layer is built without .with_ansi(false) (crates/darner-core/src/logging.rs:186 and :211; the file layers have it, :180, :205). It would go away with option (a), so I leave it out of any PR until you choose.

Options

(a) Native window everywhere. play-nvidia.ps1 hands its preload to darner.exe's window and preload-window.ps1 goes.

  • Good: one window and code path; Play now / Quit the same everywhere. Bad: no splash picture; -Splash and -NoPreloadWindow go.

(b) The native window draws the title's splash behind it.

  • Good: one window, the splash look stays. Bad: preload_ui.rs must read MicrosoftGame.config and the image at run time, and draw more.

(c) Keep both, and document which launcher shows which.

  • Good: no behaviour change. Bad: two windows to keep in step (strings, buttons, the --all difference).

Overlap searched

Searched open and closed issues and pull requests for "preload window", "splash", "preload_ui", "preload-window", "preload", "preload launcher". Nothing asks this question. Related: #128 and #140 (what the native window remembers about an unfinished preload; #140 is a draft for step 1 of #128) and #153 (the done mark across exe copies). They concern the native window; the choice here decides whether they also have to cover the script window. #165 touches the preload launcher's job count.

Spec dependence

Likely general: this is about launchers and window code, not about a graphics card, driver or Series S / X profile. Not tested on anything.

Are you working on a fix?

No, not until you pick one. We can do the PR once you choose.

Drafted with AI assistance (Claude Code).

### What I would like to ask There are two different windows that show the shader preload, and which one you see depends on how you start the game. Which one do you want to keep? Read from `main` at `57dea7f23`. Nothing was run for this question. ### The two windows **1. The script window** (`scripts/preload-window.ps1`, a Windows Forms / GDI+ window made by PowerShell) - Drawn over the title's own splash picture: `-Splash`, else `SplashScreenImage` in `MicrosoftGame.config` or `xbs_splash.png` beside the exe, else a plain window (`Get-SplashImage`, `scripts/preload-window.ps1:17-50`). - Label PRELOADING SHADERS (`locales/en.json:107`), three stages SHADERS / PIPELINES / LIBRARY (`locales/en.json:136-138`), a count, elapsed time, and a "Skip and start the game" link (`en.json:128`; Skip asks for confirmation, `preload-window.ps1:192-199`). - Its only caller is `scripts/play-nvidia.ps1` (`:86` loads it, `:486` opens it when the start preloads, `-NoPreloadWindow` turns it off, `:71`). You get it with `play-nvidia.ps1 -Preload`, and with `PLAY_FRAMEGEN.cmd` and `PLAY_FACES_FIX.cmd`, which end in `play-nvidia.ps1` (`scripts/play-nvidia-framegen.ps1:232`). The window is fed by the `darner preload <folder>` that the script starts (`play-nvidia.ps1:490`). **2. The native window** (`apps/darner/src/preload_ui.rs`, drawn with GDI inside `darner.exe`) - Title "Preparing shaders" (`locales/en.json:787`), the step, a bar, time left, and two buttons: Play now and Quit (`preload_ui.rs:1-4`, `:312-333`). Drawn in the project's colours, no picture (`preload_ui.rs:12`). - Used by `darner.exe play`: the preload a first start runs by itself (`apps/darner/src/main.rs:690-693`, `play.rs:748-749`) and `Play-MyRig.cmd` (`scripts/play-rig.ps1` starts `darner play ... --preload`, `:517`, `:809`). - It runs `darner preload <folder> --all` (`preload_ui.rs:159-161`). The script window runs `darner preload <folder>` without `--all` (`play-nvidia.ps1:490`), so the two preloads are not the same job. I have not traced what each one ends up making. **F1 > PRELOAD SHADERS** opens whichever window belongs to the launcher that started the game. The menu restarts that launcher with `DARNER_PRELOAD=1` (`crates/darner-gpu/src/host/menu.rs:1264`; `play-nvidia.ps1` sets itself as the launcher at `:374`, and reads the variable at `:90`; `darner play` reads it at `main.rs:674`). **`Play-Darner.cmd` shows neither**: it runs `darner.exe run ... --execute` (`Play-Darner.cmd:44`), which does not preload. The native window arrived in `a7d321b14` (2026-12-01). ### One small bug in the script window (observation only) A tester reported that the newest log line at the bottom of the script window shows raw colour codes (the `[2m...[0m [32m INFO` kind). Likely cause, from reading the code and not confirmed: the script only cuts the time and level off a line with the pattern `^\S+Z\s+(TRACE|DEBUG|INFO|WARN|ERROR)\s+` (`preload-window.ps1:418`) and never strips colour codes (no code for it anywhere under `scripts/`), while the console log layer is built without `.with_ansi(false)` (`crates/darner-core/src/logging.rs:186` and `:211`; the file layers have it, `:180`, `:205`). It would go away with option (a), so I leave it out of any PR until you choose. ### Options (a) **Native window everywhere.** `play-nvidia.ps1` hands its preload to `darner.exe`'s window and `preload-window.ps1` goes. - Good: one window and code path; Play now / Quit the same everywhere. Bad: no splash picture; `-Splash` and `-NoPreloadWindow` go. (b) **The native window draws the title's splash behind it.** - Good: one window, the splash look stays. Bad: `preload_ui.rs` must read `MicrosoftGame.config` and the image at run time, and draw more. (c) **Keep both, and document which launcher shows which.** - Good: no behaviour change. Bad: two windows to keep in step (strings, buttons, the `--all` difference). ### Overlap searched Searched open and closed issues and pull requests for "preload window", "splash", "preload_ui", "preload-window", "preload", "preload launcher". Nothing asks this question. Related: #128 and #140 (what the native window remembers about an unfinished preload; #140 is a draft for step 1 of #128) and #153 (the done mark across exe copies). They concern the native window; the choice here decides whether they also have to cover the script window. #165 touches the preload launcher's job count. ### Spec dependence Likely general: this is about launchers and window code, not about a graphics card, driver or Series S / X profile. Not tested on anything. ### Are you working on a fix? No, not until you pick one. We can do the PR once you choose. Drafted with AI assistance (Claude Code).
Contributor

Minor subtask of this: We're going to rename play-nvidia to build-darner, to reduce confusion. Only developers need to be compiling it, normal users will use a release-built exe.

Minor subtask of this: We're going to rename play-nvidia to build-darner, to reduce confusion. Only developers need to be compiling it, normal users will use a release-built exe.
Contributor

I would keep the native window and have the launchers call darner.exe play. The warm-up scope deserves its own migration check because the two windows also select different work today.

On 57dea7f, both paths scan the title files for shaders. The script's plain preload warms only the pipelines in early-pipelines.txt once the list has enough entries. Below that threshold it warms every known candidate, as the native window does with --all. Both then save eligible early and slow pipelines into the host library using the library step's own selection. Native invocation · Preload dispatch · Library selection

I ran the extracted preload_used helper with Rust 1.98.1 for both invocations with and without a populated list. All four cases matched. I would include those two cache states in the migration check and decide explicitly whether a script user with an existing list should switch to the full warm-up. This was an isolated check of the selection logic.

I would keep the native window and have the launchers call `darner.exe play`. The warm-up scope deserves its own migration check because the two windows also select different work today. On `57dea7f`, both paths scan the title files for shaders. The script's plain `preload` warms only the pipelines in `early-pipelines.txt` once the list has enough entries. Below that threshold it warms every known candidate, as the native window does with `--all`. Both then save eligible early and slow pipelines into the host library using the library step's own selection. [Native invocation](https://git.gtahub.st/TrustNo1/Darner/src/commit/57dea7f2367c4e902b8ef507f90536564b670b04/apps/darner/src/preload_ui.rs#L154-L165) · [Preload dispatch](https://git.gtahub.st/TrustNo1/Darner/src/commit/57dea7f2367c4e902b8ef507f90536564b670b04/apps/darner/src/main.rs#L776-L799) · [Library selection](https://git.gtahub.st/TrustNo1/Darner/src/commit/57dea7f2367c4e902b8ef507f90536564b670b04/apps/darner/src/warm.rs#L504-L531) I ran the extracted `preload_used` helper with Rust 1.98.1 for both invocations with and without a populated list. All four cases matched. I would include those two cache states in the migration check and decide explicitly whether a script user with an existing list should switch to the full warm-up. This was an isolated check of the selection logic.
Author
Contributor

Note: a01d8f0dc on main strips the colour codes from the darner preload lines in the script's window, which was the side bug mentioned here (checked by reading the code, not a run). The main question (which of the two preload windows stays) is still open.

Drafted with AI assistance (Claude Code).

Note: a01d8f0dc on main strips the colour codes from the darner preload lines in the script's window, which was the side bug mentioned here (checked by reading the code, not a run). The main question (which of the two preload windows stays) is still open. Drafted with AI assistance (Claude Code).
Contributor

The primary issue is that the pretty scripts/preload-window.ps1 isn't part of the executable, and is a seperate powershell script.

The obvious solution is to remove it, and run darner.exe -preload -all (or whatever the params are) as part of a development build. As long as it doesn't rebuild things that it has already built, that should be fine for most developers.

The primary issue is that the pretty scripts/preload-window.ps1 isn't part of the executable, and is a seperate powershell script. The obvious solution is to remove it, and run darner.exe -preload -all (or whatever the params are) as part of a development build. As long as it doesn't rebuild things that it has already built, that should be fine for most developers.
Sign in to join this conversation.
No labels
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#166
No description provided.