Skip to content

Update unedited lighting profiles on upgrade - #57

Merged
sambvfx merged 2 commits into
NVIDIAGameWorks:mainfrom
JimmyfaQwQ:refresh-untouched-shipped-profiles
Nov 3, 2026
Merged

sambvfx merged 2 commits into
NVIDIAGameWorks:mainfrom
JimmyfaQwQ:refresh-untouched-shipped-profiles

Conversation

@JimmyfaQwQ

Copy link
Copy Markdown
Contributor

Fixes #20.

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, 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 .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.

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: ShippedPayloadHistoryTest walks packaging/rtx-remix/ and 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.

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=win64 passes, including verifyPackageJar.
  • New NativeExtractorTest cases 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.
  • Changing water.conf without appending its hash makes ShippedPayloadHistoryTest fail with the line to append.
  • Simulated upgrade with the packaged win64 JAR on the classpath (its own zip paths and bundled list): a game directory holding the 0.1.0 payload from git archive (CRLF), with day.conf edited and a 0.1.0 marker. After extractIfNeeded, the payload README took the new default, the edited day.conf kept its edit, and the marker moved to the new version.
  • Not done: the same upgrade through a launcher with the game running. tools\rtx.bat check --tests was 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 install still copies the payload with copytree(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

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>
@JimmyfaQwQ
JimmyfaQwQ requested a review from sambvfx as a code owner October 27, 2026 09:51
sambvfx
sambvfx previously approved these changes Nov 2, 2026

@sambvfx sambvfx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sha256 says NativeExtractorTest fails with the line to append; it's ShippedPayloadHistoryTest.
  • The # Unreleased heading 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.

@sambvfx

sambvfx commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

I merged #61 first, and it also adds a Fixed entry under Unreleased in CHANGELOG.md, so this now conflicts with main. Could you merge main and keep both entries? I'll merge as soon as CI is green. CHANGELOG.md goes away in an upcoming release change, so the order and wording don't matter.

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>
@JimmyfaQwQ

Copy link
Copy Markdown
Contributor Author

I merged #61 first, and it also adds a Fixed entry under Unreleased in CHANGELOG.md, so this now conflicts with main. Could you merge main and keep both entries? I'll merge as soon as CI is green. CHANGELOG.md goes away in an upcoming release change, so the order and wording don't matter.

Thanks for the review! I merged the main branch while keeping both 'Fixed' entries in the changelog, and the ShippedPayloadHistoryTest nit you mentioned has also been addressed in the latest commit. The build and tests are still clean on my end, pending your approval to run the remote CI. Let me know if you spot anything else!

@sambvfx sambvfx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for merging main and keeping both entries. CI is green, so merging now.

@sambvfx
sambvfx merged commit a756f93 into NVIDIAGameWorks:main Nov 3, 2026
4 checks passed
SamitMohnot added a commit to SamitMohnot/rtx-remix-minecraft that referenced this pull request Nov 3, 2026
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>
AlexMelanFromRingo added a commit to AlexMelanFromRingo/rtx-remix-minecraft that referenced this pull request Nov 3, 2026
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>
AlexMelanFromRingo added a commit to AlexMelanFromRingo/rtx-remix-minecraft that referenced this pull request Nov 3, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mod updates don't deliver changed lighting profiles to existing installs

2 participants