Repository navigation
Update unedited lighting profiles on upgrade - #57
Conversation
An install never received changed defaults for the shipped lighting profiles under rtx-remix/mods/minecraft-logic/. NativeExtractor skipped every author-owned file that already existed, because it could not tell an untouched default from an author's edit, so a retuned profile reached a player only after they deleted their copy. The JAR now carries rtx-remix-shipped-payload.sha256, the SHA-256 of every version of each payload file that has shipped, seeded with the 0.1.0 payload. extractAuthorTree replaces an existing file only when its hash is a shipped version of that same path; any other content is an edit and is kept. Missing files are still written, so deleting a file still restores its default, and a file already matching the current default is not rewritten. Hashes fold CRLF to LF. The .conf payload has no .gitattributes rule, so the line endings packaged into the JAR depend on the builder's git configuration, and editors convert them; neither is an edit. Keeping the list in the JAR rather than recording hashes in the game directory leaves no install-side state to lose, and 0.1.0 installs, which recorded nothing at extraction, still receive the next release's defaults. A payload change must append its hash: ShippedPayloadHistoryTest fails with the exact lines to append, and verifyPackageJar requires the list in the JAR, since extraction refuses to run without it. This change edits the payload README, so it appends that file's new hash. Fixes NVIDIAGameWorks#20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Junyu Tao <jimmyfa@jimmyfa.xyz>
sambvfx
left a comment
There was a problem hiding this comment.
Thanks, nice approach. I tested it as a real upgrade: a Prism instance holding the 0.1.0 profiles, an old version marker and a hand-edited day.conf, launched with the packaged JAR from this branch. The log showed the README being updated and 1 edited file kept. On disk the README matched the current default, day.conf kept its edit, and the marker moved to the new version. The renderer and all 11 profiles loaded. I also checked that the 0.1.0 hashes match the v0.1.0 tag.
Two optional nits, fine as a follow-up:
- The comment in
rtx-remix-shipped-payload.sha256saysNativeExtractorTestfails with the line to append; it'sShippedPayloadHistoryTest. - The
# Unreleasedheading in that file will need relabelling when we cut the release.
This conflicts with #61 in CHANGELOG.md (both add a Fixed entry). I'll resolve that on the branch when I merge.
|
I merged #61 first, and it also adds a Fixed entry under Unreleased in |
Keep both Unreleased Fixed entries in CHANGELOG.md, and name ShippedPayloadHistoryTest in the payload hash list's header, the test that reports a missing hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Junyu Tao <jimmyfa@jimmyfa.xyz>
Thanks for the review! I merged the main branch while keeping both 'Fixed' entries in the changelog, and the |
sambvfx
left a comment
There was a problem hiding this comment.
Thanks for merging main and keeping both entries. CI is green, so merging now.
Bring in NVIDIAGameWorks#57. Both added a Fixed entry at the top of Unreleased in CHANGELOG.md; keep NVIDIAGameWorks#57's there and move this branch's to the end of the list. Every other file merged without a conflict. Signed-off-by: Samit Mohnot <106000727+SamitMohnot@users.noreply.github.com>
Brings in the end portal and gateway surfaces (NVIDIAGameWorks#68) and the lighting profile upgrade (NVIDIAGameWorks#57). NVIDIAGameWorks#68's code uses Mojang names: the end portal and gateway programs are RenderStateShard.RENDERTYPE_END_PORTAL_SHADER and RENDERTYPE_END_GATEWAY_SHADER, compared against CompositeState.shaderState, the bake reads textures through Resource.open and NativeImage.getPixelRGBA, and its tests draw with addVertex and setUv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Alex Melan <59925151+AlexMelanFromRingo@users.noreply.github.com>
Brings in the end portal and gateway surfaces (NVIDIAGameWorks#68) and the lighting profile upgrade (NVIDIAGameWorks#57) through NVIDIAGameWorks#78. On 26.3 the surfaces are recognised by RenderPipelines.END_PORTAL and END_GATEWAY, which need no access widener; the bake reads end_portal.png from its 26.x folder, textures/entity/end_portal/, and takes NativeImage.getPixel's ARGB. The payload history records the 26.3 minecraft-logic README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Alex Melan <59925151+AlexMelanFromRingo@users.noreply.github.com>
Fixes #20.
An install never received changed defaults for the shipped lighting profiles under
rtx-remix/mods/minecraft-logic/.NativeExtractorskipped every author-owned file that already existed, because it could not tell an untouched default from an author's edit, so a retuned profile reached a player only after they deleted their copy.The JAR now carries
rtx-remix-shipped-payload.sha256, the SHA-256 of every version of each payload file that has shipped, seeded with the 0.1.0 payload.extractAuthorTreereplaces an existing file only when its hash is a shipped version of that same path; any other content is an edit and is kept, as before. Missing files are still written, so deleting a file still restores its default. A file already matching the current default is not rewritten.Hashes fold CRLF to LF. The
.confpayload has no.gitattributesrule, so the line endings packaged into the JAR depend on the builder's git configuration, and editors convert them; neither is an edit.The list lives in the JAR rather than in the game directory, so there is no install-side state to lose, and 0.1.0 installs, which recorded nothing at extraction, still receive the next release's defaults. A payload change must append its hash:
ShippedPayloadHistoryTestwalkspackaging/rtx-remix/and fails with the exact lines to append, andverifyPackageJarrequires the list in the JAR, since extraction refuses to run without it. This change edits the payload README, so it appends that file's new hash.The 0.1.0 hashes come from
packaging/rtx-remix/at the import commit; the payload has not changed since, and the v0.1.0 release archive was built from 170197a.AGENTS.md, PLAYING.md, TUNING.md, INSTALL.md, the payload README, and the changelog describe the new behaviour.
Verification:
.\gradlew.bat build test package -Parch=win64passes, includingverifyPackageJar.NativeExtractorTestcases cover: an earlier shipped default is updated on a version change; content matching no shipped version is kept; another path's shipped content is not accepted; CRLF-only differences are not an edit; a file already matching the current default is left byte-for-byte alone.water.confwithout appending its hash makesShippedPayloadHistoryTestfail with the line to append.git archive(CRLF), withday.confedited and a 0.1.0 marker. AfterextractIfNeeded, the payload README took the new default, the editedday.confkept its edit, and the marker moved to the new version.tools\rtx.bat check --testswas not run locally (uv below the required 0.13); the changed files were scanned against the public-boundary patterns by hand.Not changed:
tools\rtx.bat installstill copies the payload withcopytree(dirs_exist_ok=True), which overwrites edited profiles. That is the developer install path and is left for a separate change.🤖 Generated with Claude Code