Repository navigation
fix(forge): OptiFine runs on Forge; processors run as Forge's installer runs them - #519
Merged
Merged
Conversation
…er does
Launch classpath (spec 2026-10-16 §3):
- every era ends -cp with a version jar, as the official launcher does;
a profile whose JVM args name ${version_name} (BootstrapLauncher-era
Forge 1.17-1.20.x, NeoForge 20.x-21.x) gets a link/copy of the vanilla
jar under exactly that name (launch::version_jar), sha1-checked at
every launch; other profiles get the vanilla jar itself
- the patched-client entry Lucerna injected ("ADDENDUM D") is gone, and
old caches' copy of it is kept off -cp and out of verify's library plan
- one pure composition rule (launch::classpath) shared by spawn and the
loader matrix harness
clientId/xuid (§4): both substitute to "", which MC reads as "not given".
Processors (§5):
- every Forge/NeoForge processor runs its jar's Main-Class on Java, with
declared outputs checked against install_profile SHAs (cache hit,
delete-on-mismatch, post-run check), in one stage shared by the
transitional and modern installers, under a per-version lock
- DOWNLOAD_MOJMAPS stays in Rust through network::; --sanitize reproduces
srgutils 0.5.10's TSRG byte for byte (fixture generated by srgutils;
MOJMAPS_SHA reproduced for 1.20.6, 1.21.1, 1.21.11)
- install_version rebuilds stale declared outputs (refused while a game
runs); verify plans them, plus the patched client jar
- the pure-Rust jarsplitter, binarypatcher, installertools, SpecialSource,
FART and ART reimplementations are deleted, with xz2/lzma-sys
- processors run on the console java.exe with no window
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tput checksum mismatch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e Forge fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd-processors # Conflicts: # src-tauri/src/forge/patcher/binarypatcher.rs # src-tauri/src/forge/patcher/jarsplitter.rs
…ently, not corrupt A Forge processor output whose bytes differ from what the installer declares gets its own status, BuiltDifferently, counted apart from corrupt and missing. Older Lucerna versions built these files with their own code; the game launches with them, and one Repair rebuilds them with Forge's own processors. Integrity says so in EN and RU instead of calling them corrupt. An instance.json saved before the count existed reads it as 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd-processors # Conflicts: # src-tauri/src/launch/spawn.rs
… network test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oordinates - One stage lock for every Forge/NeoForge version: outputs are shared across Forge builds of one Minecraft version. - A rebuild and a launch exclude each other on both sides: the rebuild refuses while a game runs or starts and marks itself; launch::start checks the mark after claiming its slot. - Every processor's jar, classpath and arguments are checked before any stale output is deleted. - No processor classpath is fetched by a guessed URL without a checksum; a missing entry stops the install, as in Forge's installer. - A missing patched client jar makes Repair rebuild it. - Downloads skip the patched-client entry Lucerna <= 0.27 injected; Forge 1.20.6+'s own :client library reads as built differently, not corrupt. - maven_coord_to_relative_path keeps the @ext after a classifier: Forge 1.20.4+ declares outputs such as mappings@tsrg (found by the era matrix). - mojmaps scratch files are named after the whole output name and removed on failure. - Copy and docs scoped to what is measured; RU row uses plural forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AntonBabchenko
enabled auto-merge (squash)
October 18, 2026 01:33
This was referenced Oct 18, 2026
AntonBabchenko
added a commit
that referenced
this pull request
Oct 18, 2026
* docs(changelog): audit [Unreleased] for v0.28.0 Every bullet was checked against the code at f16c280 and, for Fixed, against the v0.27.0 tree, by three read-only audits and a skeptic pass; each finding was re-checked by hand. Moved or dropped: - Link marking moves from Fixed to Changed: v0.27.0 already followed a linked content root on import, clone and export; only the label is new. - The data pack library note joins the folder-button bullet: the library had no way in from the UI before that button. - The language-picker bullet is dropped: only en and ru ship, ru is 100% translated, and System still resolves ru* to Russian and the rest to English. - New Fixed: a clone copied the pack files but not their list, so packs installed from Add-ons were missing from its Installed tab. Tightened (claims the code does not make): - Shared data lives on the instance's Settings tab; DH and Voxy copy multiplayer data; "other folders" are the game folder's. - Settings sync: the new-instances checkbox is off by default and also covers clients made from a server; history needs 1.20.2+, hotbars a release from 1.14, game options a release from 1.13 to 26.3; graphics mode syncs, so "how the game looks" rather than "graphics settings". - The damaged-file repair replaces whichever file is damaged, not a choice. - Pack removal: unpacked packs and zips not from Modrinth/CurseForge go to the recycle bin, the rest are deleted. - Own Java refuses to start; the Java rescue fires whenever Lucerna can't get its Java, and "all instances" only for one that follows Settings. - Java never sat in the Manage window; the sidebar menu items are named. - OptiFine is proven on Forge 1.20.1 only, and "classpath" is jargon. - ${clientid}/${auth_xuid} reached the game from 1.18 on. - The old network message was "check your internet connection" in most places; Reload is offered for Minecraft, loader and server-core version lists. - A Forge installer is "unverifiable" only when no checksum is published. - Server/instance conversion refuses only a broken mods-folder link; a failed pack removal shows the error. Fixed is ordered by theme: Forge and launch, network and lists, folders, packs, macOS, shaders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(changelog): split the Forge build bullet into Fixed and Changed Design review of #519 (F7): "built the way Forge's own installer builds them" is a property, so it is Changed; what was broken at v0.27.0 is Verify flagging a Forge 1.20.6+ file after every check that Repair never rebuilt. The Changed bullet does not call built-differently files problems, and the RU drops the calque «одно «Восстановить»». Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(changelog): apply the skeptic pass to the merged audit - The Java rescue's "every instance" button sets the Settings default, which reaches only instances on that Java version that follow Settings. - Export is offered only for modded instances, so the sidebar menu example names Clone instead. - Reload is offered only when a version list couldn't be fetched, and the third list is the server core's. Checked and kept: built-differently files are Forge-only (NeoForge declares no processor outputs, spec table "NeoForge (any) | none declared"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
AntonBabchenko
added a commit
that referenced
this pull request
Oct 18, 2026
…ywhere (#526) * fix: Forge files built differently, or not checked, are not damage anywhere v0.28 design review of #519 (F1–F3); #519's spec §5.5 revisited 2026-10-18 by the orchestrator on the maintainer's delegation. - F1: the note says the game still starts with these files AND that they can be left as they are: Repair is optional (it deletes before it rebuilds). With no damage found, Repair is a secondary button. - F3: a Forge installer that is not saved, or not readable, was a Libraries problem «1 missing» (red). It is now ArtifactStatus::Unchecked, counted in no category and no total, with VerifyReport/IntegrityStatus .forge_installer (not_saved | unreadable) giving it a line of its own; Repair still runs the full install that downloads it. - F2: summarizeIntegrity tells notes from damage for every surface: with only notes the sidebar draws no glyph, the Overview raises no «Needs attention» and its card says «No damage found», Verify's toast is a success; the Integrity section is the one place that explains. Any damage counts as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: notes stay notes only when they are; an unchecked Forge is said so Review of #526: - An unreadable manifest beside notes was classed «no damage found»; IntegrityStatus now keeps manifest_recoverable and the summary counts it as damage. - A notes-only result never went stale and showed «No damage found» in every later session; it is now session-scoped like a healthy one. - Forge's own files not checked: Verify's toast is a warning, «no damage found, but Forge's own files weren't checked», and the Overview card says the same, instead of a full pass. - «can't be read» no longer promises a download Repair does not do (a corrupt cached installer is never re-fetched — ROADMAP); «isn't saved» says Repair also rebuilds the files that differ. - The Rust test builds the installer problem with the real builder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
AntonBabchenko
added a commit
that referenced
this pull request
Nov 5, 2026
…ows (#543) * fix: pass the profile's JVM arguments in a Java argument file on Windows Windows caps a command line at 32 767 characters, and the classpath grows with every library times the data folder path. A 26.x loader profile crossed it from a data root of ~110 characters (os error 206); #519 measured Forge 26.2 failing at 172. On Windows with Java 9+ the version profile's JVM arguments now go in instances/<id>/jvm-args.txt, named as @<file> on the command line. The user's own JVM arguments stay in front of it, the main class and game arguments (with the access token) after it. Java 8, Linux and macOS keep the command line. - The Java major is measured: the probe for a chosen Java, the runtime's release file for Lucerna's own; unknown means the command line. - The file holds no escape and no comment, quotes only space/TAB/FF/#/' runs (and " in single quotes), keeps backslashes unquoted, and ends every argument with LF: safe for DBCS trail bytes (0x5C) and for the JDK 9-11.0.1 and pre-JDK-8231863 readers. LF/CR, NUL, U+001A and a leading @ are refused. - Bytes are the ANSI code page without best fit (UTF-8 when that is the code page), as java.exe converts its own command line; a character the code page lacks is refused and named. - ${auth_access_token} and ${auth_session} are substituted in game arguments only, so the token never reaches the file. - --disable-@files (instance args or JDK_JAVA_OPTIONS) keeps the command line. The file is kept after exit (restart mods re-run @<file>) and removed after a failed spawn or a command-line launch. * fix: leave no stale argument file and compile the launch integration tests Review follow-ups to the argument-file change: - tests/launch_pipeline_integration.rs and tests/loader_matrix_e2e.rs still read build_argv's old flat Vec; they now compose the argv with launch::argfile::command_line, as launch::spawn does. - A refused or failed write removes the file, so an earlier launch's file never passes for this one's. - A quoted --disable-@files in JDK_JAVA_OPTIONS counts (the launcher unquotes it), and a non-Unicode value is read lossily, not as unset.
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.
Summary
OptiFine on Forge 1.20.1 loaded but stayed inactive. Two things in Lucerna's launch classpath caused it, and both were proven by isolation runs:
forge-<v>-client.jar) was on-cp.Library order was irrelevant.
This PR launches Forge the way the official Minecraft launcher does, and builds Forge installs the way Forge's own installer does.
A. Launch classpath (
launch/classpath.rs,launch/version_jar.rs)-cp, as the official launcher puts it forinheritsFromprofiles.versions/<synth>/<id>.jaronly where the profile's JVM args name${version_name}. That is the BootstrapLauncher-DignoreListeras: Forge 1.17–1.20.x and NeoForge.mods::store::materialize. The source is checked against the JSON's sha1 first.net.minecraftforge:forge:<v>:cliententry that Lucerna ≤ 0.27 added to merged JSONs is dropped from the classpath and from Verify.ClientJarInvalid { mc_version, missing }, with EN/RU copy pointing to Integrity → Verify/Repair.B.
${clientid}/${auth_xuid}They are substituted as empty strings instead of reaching the game as literal text.
C. Forge processors run as Forge's installer runs them (
forge/installer/processors.rs)Main-Classruns on Lucerna's Java, with the installer's own arguments and classpath.DOWNLOAD_MOJMAPS --sanitizeis the exception: it is a byte-exact Rust port of srgutils 0.5.10 that downloads throughnetwork::.install_profile.json's*_SHAthe way the official installer checks them:ForgeProcessorOutputMismatch.xz2dependency.ensure_processor_outputsrebuilds an existing install whose outputs differ, frominstall_version, so Install and Repair. Launch never runs it. The rebuild is refused while a game runs.BuiltDifferently, notCorrupt. Integrity says the files were built differently from Forge's own installer, that the game still launches with them, and that Repair rebuilds them the way Forge's installer does. EN and RU; spec 2026-10-16 §5.5.Docs
docs/PRINCIPLES.mdAppendix A has one bounded processor row in place of five, and its "Selective Java subprocess" paragraphs are rewritten.docs/TESTING.mdfixture and ignored-test rows are updated.ru.md.Dependencies
xz2(and transitivelylzma-sys) is removed. No crate is added.Test plan
TDD units, each seen red on a stub or mutation first:
${…};StageIo(14);@extafter a classifier;BuiltDifferently;cargo test --lib -- forge:: verify:: versions::libraries launch::on the merged base (feat: share the server list, command history and hotbars between instances (Shared data, step 2) #517): 310 passedAll 25
structural_*guards pass.--export-bindings --checkreports bindings up to datemojmaps_network(#[ignore]): the port reproducesMOJMAPS_SHAfor 1.20.6, 1.21.1, 1.21.11vitest
integrity-section(10),changelog-parity(6),format-errorEra matrix
loader_matrix_e2eon the final code. All 42 combos reached the menu:Runs:
@extbug:[…:mappings@tsrg]outputs were looked for as.jar.The three run-2 failures were the scratch data root's 172-character path, not this change:
They passed with a short root. Both limits pre-date this PR (no Java
@argfile, per-synth natives paths) and are noted for the roadmap.Upgrade path in a throwaway data root (
com.lucerna.forgecp):origin/mainbuild: Forge 1.20.1-47.4.10 (110 s) and Forge 1.21.1-52.1.14 (88 s)..tsrg, MC_OFF, PATCHED);*_SHA, and the 1.20.1 patched jar also equals thePATCHED_SHAForge does not declare. Verify is healthy and both launch to the menu.OptiFine I6 (sha1
227914ab…) on the repaired Forge 1.20.1, installed throughmods_install_local(the UI's local-jar path) and launched to the menu in 37 s. Log markers:[OptiFine] OptiFine_1.20.1_HD_U_I6fromnet.optifine.Configon the Render thread;shaderpacks/created;MD5 not matching;Base resource not found.No computer-use, and nobody clicked in a game window.
Re-check on the final head
6eea5dbf(origin/maina4664719merged in, with feat: share the server list, command history and hotbars between instances (Shared data, step 2) #517 and feat: share game options between instances (Shared data, step 3) #523 changing launch code):cargo test --lib -- forge:: verify:: versions::libraries launch::: 310 passed;shaderpacks/deleted beforehand and recreated by OptiFine; menu in 41.5 s;mappings@tsrg), and it reaches the menu in 33.3 s.CI green
Review
90ffc353..50943228.rebuild_in_progress,is_any_starting);classpath_coords_to_librariesremoved);:cliententry is skipped in downloads;:clientrow reads as built differently;maven_coord_to_relative_pathdropped@extafter a classifier. Forge 1.20.4+ declares…:mappings@tsrgoutputs, so they were looked for as.jar.launch::startdoes not re-checkverify::repair_in_progress()after its claim. This is pre-existing.Live checks: disk and time
TMP. Removed.%APPDATA%com.lucerna.forgecp, 1.4G, about 15 min. It was kept for the final-head re-check and has now been removed.CARGO_TARGET_DIR(lib tests, test binaries, two dev exes: this branch andorigin/main).🤖 Generated with Claude Code