Documentation
Build, CI/CD & replay
Reproducible Gradle 8.14.3 builds, repository layout, protected GitHub Actions workflows, and offline SHA-256 replay verification.
MTR Memory Saver v0.4.9 targets Official MTR 4.1.0-beta.2 through 18 Mixins & Accessors (13 common + 5 official-target). See Technical principles for the full four-layer architecture diagram, 7 -D properties, and 18-Mixin inventory, and Runtime contract & review for concurrency and cancellation invariants.
Four-Layer Runtime Summary
- Exact Binary Identity Gate (
CompatibilityPlugin/BinaryFingerprint): Streams the active MTR JAR SHA-256 during MixinonLoadand throwsMixinInitialisationError(exit 1) before any vehicle registration if bytes differ fromff2b753d03f2bcc000d053a9014e4250c8ba720daa9b69b6899fe7dc26be1efa. - Two-Level Bounded Single-Flight Scheduling (
GenerationWorkCache): Checks L1 path keys to skip I/O and hashing; enforces a fair2 + 64semaphore queue; releases snapshot channels and read permits before L2 Blockbench content-alias waiters attach; isolates.mtlmaterials per path (StreamedObjCache); retires reload generations atomically under a single lock (beginReload()). - Single-Pass Streaming Snapshots &
96 MiBLRU (SnapshotResourceProvider/Utf16TextSnapshot): Wraps only the 5 audited officialResourceProviderentry points, streaming.bbmodel/.obj/.mtlthrough a singleCREATE_NEW | READ | WRITE | DELETE_ON_CLOSEchannel while computing UTF-8 SHA-256 in oneFilterReaderpass; spills oversized legacyreadResourcecalls safely via fair-shareTextWorkspace; caps retained text in a96 MiBDeflater.BEST_SPEEDLRU. - Lossless 36B Compressed Meshes & Shared JSON (
PackedVertices/DisplayRetention/VehicleJsonCache): Compresses CPU-sideStoredVertexDatainto fixed 36-byte chunks preserving exact raw float bits and AABB collision boxes; retainsPartType.DISPLAYtransforms only; shares identical non-empty vehicleJsonObjecttrees per epoch.
Reproducible Source Builds (BUILDING.md)
Building and running headless test suites require Java 21 JDK (JAVA_HOME) and optional Python 3 (requirements-test.txt). The checked-in Gradle 8.14.3 wrapper verifies its own distribution checksum and ModDevGradle downloads/caches dependencies directly—never reading any game-test instance marker or launcher-private Python API:
# Clone repository (use PowerShell 7 + ./gradlew.bat on Windows; ./gradlew on Linux/macOS)
git clone https://github.com/teamCreating/MTR-Memory-Saver.git
cd MTR-Memory-Saver
# Build the default official-nf265 JAR and .build.json identity manifest
./gradlew.bat build -Ptarget=official-nf265
# Supply an explicit audited JAR or run offline with cached Gradle dependencies
./gradlew.bat build -Ptarget=v6-nf265 -PmtrJar="<exact custom MTR JAR>"
./gradlew.bat build --offline
# Produce deterministic release ZIP + .build.json under build/releases/
./gradlew.bat releaseBundle
- Single Matrix Authority: config/targets.json selects source directories, exact MTR SHA-256, exact NeoForge version, metadata, and Mixin sets; gradle.properties holds the sole version string.
- Deterministic Outputs:
build/libs/outputs the target-named JAR and.build.jsonmanifest (stable timestamps and entry order so clean rebuilds yield identical JAR SHA-256 digests); optionalprobeJardiagnostic tools are excluded from standard bundles. - Artwork:
src/main/resources/pack.png(512x512RGBA) is committed in-repo; standard builds need no Pillow orrequirements-artwork.txt.
Repository Layout
src/main/java/— Shared Mixins, bounded scheduler, streaming snapshots, text workspace/LRU, packed mesh store, JSON/display sharingsrc/targets/official/java/— Official MTR4.1.0-beta.2adapters (StreamedObjCache,ResourceTextReadMixin,VertexColorMixin, etc.)src/targets/v6/java/— Historical customPerformance v6ABI target (currently paused)config/— Authoritative build matrix (targets.json) and frozen experiment policiesevidence/&performance/— Immutable, hash-indexed failure/pass captures with offlineverify_sealed.pyreplay scriptstools/&tests/— Acceptance harnesses, JFR/Spark exporters, and354Python regression tests
CI/CD & Branch Protection (CI_CD.md)
- Cross-Platform CI (
.github/workflows/build.yml): Runs on Linux and Windows Server 2022 across pushes, PRs tomain, merge groups, and releases—executing Python tests (minecraft_testkit verify/test), official target builds, Java unit suites, independent observer tests, and bundle verification (Windows Server CI does not substitute for live Windows 10 gameplay acceptance). - Rulesets (
.github/main-ruleset.json/release-tags-ruleset.json):mainrequires PRs, linear history (squashorrebase), and all required CI checks with no admin bypass;v*release tags cannot be edited or deleted. - Automated Release & Dry-Run (
.github/workflows/release.yml): Pushing a matching tag (v0.4.9) re-runs full CI, validates.zip/.jarmanifests and fingerprints, and publishes formal tags asLatestusingdocs/releases/<tag>.md(hyphenated tags publish aspre-release). Manual workflow runs dry-run all build and fingerprint checks without creating a tag or GitHub Release.
Local Verification & Offline Cryptographic Replay
Headless Java & Python Suites
# Run all 106 Java unit & regression tests (including -Xmx64M OOM controls)
./gradlew.bat test
# Verify 682 historical script entries and run 354 Python tool tests
python -m pip install -r requirements-test.txt
python -X utf8 -m minecraft_testkit verify
python -X utf8 -m minecraft_testkit test
Read-Only Offline Evidence Replay
No Minecraft installation is required to audit sealed payload hashes, log prefix chains, and outlier sensitivity reports from evidence/ (exit code 0 confirms complete consistency):
# Read-only replay of 20-reload passes and negative OOM controls
python -X utf8 evidence/engineering-056/nf265-reload20/verify_sealed.py
python -X utf8 evidence/engineering-052/revised048-reload20/verify_sealed.py
python -X utf8 evidence/engineering-051/streamed051a-reload-oom/verify_sealed.py
# Scripts writing summary JSON into temporary .cache/
python -X utf8 evidence/engineering-050/owned049d-reload-attempt03-oom/verify_sealed.py .cache/recheck-050.json
python -X utf8 tools/client_outlier_analysis.py --assessment evidence/engineering-054/practical-spark/assessment.json --output .cache/recheck-054-outlier.json
Five-Point Audit Checklist
- Artifact Identity: Match
build/libs/*.build.jsonagainst the 64-character SHA-256 digests in Stage records & hashes. - Fixture Scope: Distinguish legacy 16 packs (
2,541vehicles forv0.1–v0.3) from native-catalogue 16 packs (1,092declarations /1,091IDs +974OBJ for0.4.x). - Preserved Failures: Confirm
engineering-050(0/20),051(0/20),054(12-JVM fail), and0.4.2(inconclusive) remain intact in raw summaries. - Per-Epoch Log Attribution: Confirm
native-invalid-model.jsonlmatches native-diagnostic-review.json1:1per epoch without regex ignores. - Boundary Separation: Never extrapolate single-input microbenchmarks or
20/20reload endurance as a substitute for the pending 48-JVM whole-client benchmark.