Repository navigation
Experimental builder: an opt-in setting that hands stages to nxbuild - #752
Merged
Merged
Conversation
…749) nxbuild reproduces the extraction and the shader split byte for byte and much faster. Settings, Build tools gets "Use experimental builder", off by default, with the nxb binary to use. When it is on and nxb is found, the build gets DM_EXPERIMENTAL_BUILDER=1 and NXB_BIN, and the log names the binary. When nxb is missing the log says so and the standard builder runs. The engine side is patch 0073: the NSP script stays the driver and runs nxb-extract and nxb-split where nxbuild supports the case. Any other case, a failure or an output that fails the checks runs the Python step. No nxbuild release exists yet. ExperimentalBuilder pins a release URL and its SHA-256 together once there is one (both nil now), and resolves a chosen path first, then a downloaded release. frontend/README.md describes the setting, the fallbacks and the dev workflow.
…749) The app carries nxb in Contents/Resources/nxbuild, from the release frontend/nxbuild.pin names (v0.1.0, digest still a placeholder). The app build downloads the zip, checks its SHA-256 against the pin before it is unpacked and signs nxb ad hoc (frontend/tools/nxbuild.py fetch). A placeholder bundles nothing. `nxbuild.py bump <version>` pins a release from its SHA256SUMS. The runtime download design is gone: the launcher takes a chosen nxb first, then the app's copy. Patch 0073: the script takes nxb's subcommand (nxb extract, nxb split) when no stage binary sits beside nxb, as the releases ship one binary.
Collaborator
Author
|
The nxbuild release v0.1.0 is published: https://github.com/v0lumehi/nxbuild/releases/tag/v0.1.0. The pin in |
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix or feature
What and why
Closes #749 (milestone v1.2.0).
nxbuild is a new build tool in Rust. It reproduces stages of the NSP script byte for byte and is much faster there. This PR lets players try it with an opt-in setting. The standard Python build stays the default and the fallback.
Engine, patch 0073 (forwarded as seedds/nxnative#1325). The NSP script stays the driver. With
DM_EXPERIMENTAL_BUILDER=1andNXB_BIN(thenxbbinary or its folder) it runsnxb-extractfor each version andnxb-splitfor the shader split. Stage names, JSON events, the work folder and the reuse keys do not change. These cases run the Python step, with a note in the build log:--program,--allow-damaged, DLC, run-time captures, NROs, a game decoder, a provisional or derived profileExeFS/main,RomFS.imgand the profile's marker for an extraction, the data rows of the profile's shader tables for the splitnxbuild's own
[RED]lines stay in its log, so the failure classifier never sees them.Launcher. Settings, Build tools gets "Use experimental builder", off by default, with one sentence: faster, may not support every game, falls back by itself. Under it, when it is on, the
nxbprogram it uses and a Choose button. The setting is stored with the other build settings inBuildStore. The build gets the two variables, and the log names the binary. Without a usablenxbthe log says so and the standard builder runs. Texts in en, de, sv, zh and it.Shipping. The app carries
nxbinContents/Resources/nxbuild/nxb.frontend/nxbuild.pinnames the nxbuild release: v0.1.0 of v0lumehi/nxbuild, assetnxb-v0.1.0-macos-arm64.zip. The SHA-256 is stillPLACEHOLDERuntil the release is published, and a placeholder bundles nothing.build-mac-app.ymlandtools/try-localrunfrontend/tools/nxbuild.py fetch: download, SHA-256 check against the pin before anything is unpacked,nxbsigned ad hoc into Resources.nxbuild.py bump <version>pins a release from itsSHA256SUMS. Players download nothing at run time. The launcher takes a chosennxbfirst, then the app's copy. The script takes a stage binary besidenxb(nxb-extract,nxb-split) when there is one, else the subcommand (nxb extract,nxb split).frontend/README.md, section "Experimental builder", has the details and how to try a local nxbuild.Not handed over yet: the shader step, the pipeline archive and the Mac app. The shader step writes nxbuild's own
_b_cas.txt, and the script's cache pruner would then delete the whole Python shader cache. The archive is not faster than Python's. The Mac app needs the launcher build and the icon from outside. The requests are in nxbuild'sdocs/integration-requests.md.The Qt front end gets no switch: nxbuild is built for macOS on Apple silicon only, and on a Mac the SwiftUI launcher is the one to use.
Checked
cd frontend && swift test(748 tests in the app bundle, 0 failures),python3 -m unittest discover -s frontend-qt/tests,python3 -m unittest discover tools/tests,python3 tools/engine.py check. New:ExperimentalBuilderTests(which nxb is taken, the variables, the digest check),BuildStoreTests(off by default, saved, the environment and the log line),GameFolderStoreTests(the command line stays the same with the switch on),test_nsp_experimental_builder.pyin the engine (9 tests with stand-in binaries: each fallback, a stage binary or the subcommand, the update's arguments, a taken and a refused split),tools/tests/test_nxbuild_pin.py(the pin, the digest check before unpacking,SHA256SUMS).dm/tools/lint_python.pywith the pinned tools: no new finding from this patch. It reports one on main without it (dm/ios/tools/gen_manifest.py, F401).env_switches.py --checkfails on main already forDM_TOUCH_HINT,DM_TOUCH_LAYOUT,DM_TOUCH_SIZEandDM_TOUCH_STICK(patch 0070). The new switch has its row.NX_LAUNCHER_CAPTURE_DIR=<dir> swift test --filter testRenderExperimentalBuilderForVisualQA, in en, de, sv, zh and it.--platform mac-app --gpu none, stopped when the Mac shaders stage started.main9e118db, stage binariesnxb-extractandnxb-split): both extractions and the split went through nxbuild. Extract v0 17.1 s, v327680 10.1 s, split 9.1 s. All 74 files ofextract/andshader/pkg/are byte-identical to the Python build of the same game.sayline per stage nxbuild ran. I did not run a second Python-only pass for a line by line compare.Screenshots
Before, Settings, Build tools (release app and checkout):
After, release app, off, on, and on without an nxb:
After, checkout, on:
After, on, in de, sv, zh and it:
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#1325