WIP Removal of potential offensive preloader #492
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!492
Loading…
Reference in a new issue
No description provided.
Delete branch "(deleted):main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WAS ABLE TO RECREATE SPLASH SCREEN WHEN NONE WERE BEING CALLED FOR FROM GAME FILES.
Where the art came from. The art window came from scripts/play-nvidia.ps1 and scripts/preload-window.ps1
By default it read the picture from the game's own folder (the SplashScreenImage entry in MicrosoftGame.config). If you passed -Splash , it downloaded the image into a splash folder under your Darner home. That is how it came back.
Contributor role (optional)
What it changes
What I removed
preload-window.ps1
Only one script used it. I searched the whole repo, and play-nvidia.ps1 was the only thing that loaded that file.
What I changed
I've added the unblock step to play-nvidia.ps1
Files that came from a download or a zip carry Windows' "from the internet" mark, which the default execution
every .ps1 and .cmd file in the repository's top folder, which covers the launchers like Play-MyRig.cmd, and every .ps1 and .cmd file under scripts, including the subfolders. for the initial bypass compile.
play-nvidia.ps1: it no longer opens that window. During -Preload you get the plain progress lines in the PowerShell console, such as 23744 shaders in the cache, 94 % of bytes, 2 s
Play-nvidia.ps1 was also loading the language file. The deleted file loaded locale.ps1, which supplies the launcher's messages. If I had only deleted the file, the launcher would have lost its text. So play-nvidia.ps1 now loads locale.ps1 directly.
I removed every call to the old window code. The preload now just prints its lines to the console and records "done" or "ended with code N" afterward. The "skipped" outcome is gone, due to no access to Play now button without rust preloader.
-Splash and -NoPreloadWindow: both are still accepted but ignored. Old shortcuts and the F1 menu's restart pass these, so removing them would make those fail.
Things to know
Unblock command added to play-nvidia.ps1 for any files that may need it.
THIS MAY CREATE SECURITY ISSUES ON FURTHER PULLS AS THIS MAY BE ADDED TO A MALICIOUS FILE THAT IS ADDED AFTER THE FACT.
preload window should be consistent between all 3 build versions. If the rust loader fails to open in any way have a powershel/cmd environment lines describing process and updates.
quit button of the preload window is functioning but has a on/off setting (TrustNo1 said make sure quit button doesn't run command). When setting is changed you must compile the build again for the launcher to have the quit button function. The call to exit was split so it will still be made through an alt+f4 command or windows close button.
Play now still functioning properly across all 3 build loaders.
All 3 builds loaders reach 100% in steps 1 and 2.
Step 3 has not been fixed.
on initial load there is a slight pause before building pipelines step occurs, this is because the tracking does not update while the pipelines or initially warmed. Once pipelines are actually being built does step 2 properly show up and track.
Cache: a previously downloaded image may still sit in the splash folder under your Darner home (default %LOCALAPPDATA%\darner). It's harmless now, but you can delete the folder.
I HAVE NOT WRITTEN ANYTHING TO REMOVE THIS SPLASH FILE IF IT WAS DOWNLOADED ON EARLIER BUILDS.
There should be no call to find/download/use the splash from any source within this code.
All commits of this branch have detailed explanations of what changed other than
-Commit
fe4ea414c4is a main.rs edit I forgot to add description.It fixes the return match line for preload ui.
Every arm of the old match already ended the process, so the return in front of it could never run.
This created an annoying WARNING DIVERGENT CALLS message in the command lines that caused no issues with the actual functioning of the code.
How it was tested
LAST COMMIT ACTION THIS REPO IS BASED ON IS
f3840d73d3ALL TESTS RAN ON THIS BUILD BEFORE IT WS REMADE FOR CURRENT MAIN.
First test was not saved properly these are all reruns after initial tests.
cargo test --workspace --locked
Test results =
failures:
---- watch::tests::ask_once_by_res_splits_reservations_without_refusals stdout ----
thread 'watch::tests::ask_once_by_res_splits_reservations_without_refusals' (27968) panicked at crates\darner-gpu\src\watch.rs:8614:13:
assertion
left == rightfailedleft: Some(229126)
right: None
failures:
watch::tests::ask_once_by_res_splits_reservations_without_refusals
test result: FAILED. 1772 passed; 1 failed; 81 ignored; 0 measured; 0 filtered out; finished in 22.91s
cargo test --workspace --locked -p darner-gpu --lib
Test results =
failures:
---- watch::tests::ask_once_by_res_splits_reservations_without_refusals stdout ----
thread 'watch::tests::ask_once_by_res_splits_reservations_without_refusals' (34756) panicked at crates\darner-gpu\src\watch.rs:8614:13:
assertion
left == rightfailedleft: Some(237699)
right: None
failures:
watch::tests::ask_once_by_res_splits_reservations_without_refusals
test result: FAILED. 1772 passed; 1 failed; 81 ignored; 0 measured; 0 filtered out; finished in 20.62s
I BELEIVE THES FAILED DUE TO KNOWN PARALLEL PROCESS UPDATE ERROR.
Checklist
main.docs/asset-policy.md.Checked for overlap
THE PATCH TO BRING BUILD UP FROM
f3840d73d3TOd91d8e4d60HAS NOT BEEN FULLY TESTED, BUT NO CONFLICTS WERE FOUND YET.MANY EDITS MADE UNABLE TO DETAIL ALL DUE TO NOT KNOWING ALL THAT WAS ADDED BETWEEN
f3840d73d3&d91d8e4d60.Instead of text output reading "94% of shaders translated", it should read more like "23,744 shaders in cache (94%)" Parsing: the preload already prints lines like 23744 shaders in the cache, 94 % of bytes, 2 s, The window now also reads the shader count at the start of that line (preload_ui.rs). Display: the count gets thousands separators, and the percentage is the same bytes-based figure the bar already used. Steps 2 and 3 (pipelines) are unchanged. Locale text: I replaced the preload.progress.shader_percent string with preload.progress.shader_count in locales/en.json ({0} shaders in cache ({1}%)). I did the same in zh-CN.json (缓存中有 {0} 个着色器({1}%)). The Chinese wording is my own translation, so you may want to check it. Tests: I added assertions to the existing test in preload_ui.rs. It feeds in 25000 shaders in the cache, 41 % of bytes, 173 s and expects 25,000 shaders in cache (41%). assert_eq!((p.step, p.done, p.total), (1, 41, 100)); is still there above the new one. The new line checks the same three values plus p.shaders, so delete the old line. My version of the file replaces it rather than keeping both. assert_eq!((p.step, p.done, p.total, p.shaders), (1, 41, 100, 25000)): after parsing the sample line, this checks that the window is on step 1 at 41% of 100, and that it picked up 25,000 as the shader count. The last three lines: they check the text the window would show, "Step 1 of 3: Translating shaders" and "25,000 shaders in cache (41%)". This covers the locale string and the comma formatting The 3 builds preloading should be the same. All should be tracked by % of bytes translated and shaders in cache. All should have the quit button functional with a setting to disable it for now (TrustNo1 stated quit button should not run command) alt+f4 and windows close buttons still run the exit command and will close window.failures: ---- preload_ui::tests::the_preloads_lines_are_read_as_steps_and_counts stdout ---- thread 'preload_ui::tests::the_preloads_lines_are_read_as_steps_and_counts' (8112) panicked at apps\darner\src\preload_ui.rs:902:9: assertion `left == right` failed left: "Step 1 of 3: Translating shaders (0:00 in this step)" right: "Step 1 of 3: Translating shaders" note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: preload_ui::tests::the_preloads_lines_are_read_as_steps_and_counts test result: FAILED. 191 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.83s Test's window now shows the time spent in each step, so lines() returns "Step 1 of 3: Translating shaders (0:00 in this step)". When I merged the fix's test, I kept its older assertion, which expects the text without the time. The code is fine. Only the assertion is stale.Pull request closed