Skip to content

Fix NeoForge data source cache keys#119

Open
mezz wants to merge 4 commits into
neoforged:mainfrom
mezz:pr/cache
Open

Fix NeoForge data source cache keys#119
mezz wants to merge 4 commits into
neoforged:mainfrom
mezz:pr/cache

Conversation

@mezz

@mezz mezz commented Jul 13, 2026

Copy link
Copy Markdown

Problem

The cached binary-patch path (no-recompile path) could reuse patched Minecraft artifacts built from an older NeoForge userdev jar.

binaryPatch keyed the clean Minecraft jar, binpatcher tool, and textual args, but not the userdev-embedded patches.lzma data that binpatcher applies to the clean jar.

The same issue existed for access transformers: transformSources and applyDevTransforms recorded data source IDs, but not the userdev-backed data contents. Changing the NeoForge userdev jar must invalidate these cache keys even when Minecraft/NeoForm inputs and tool args are unchanged.

Observed Failure

NeoForge PR #3288 was released in NeoForge 26.2.0.10-beta. It changed the RenderArmEvent proxy parameters and updated ClientHooks.renderSpecificFirstPersonArm to the new eight-argument signature: neoforged/NeoForge#3288 (comment)

JEI then updated from NeoForge 26.2.0.6-beta, which still used the old five-argument signature, to 26.2.0.11-beta. CI reused cached binaryPatch and applyDevTransforms outputs while producing 26.2.0.11-beta artifacts. The client recipe sync test loaded minecraft-patched-26.2.0.11-beta.jar with neoforge-26.2.0.11-beta-universal.jar, then crashed because the patched Minecraft jar still invoked the old ClientHooks.renderSpecificFirstPersonArm method.

This first surfaced in JEI 26.2 build 63:
https://ci.blamejared.com/job/mezz/job/jei/job/26.2/63/consoleText

Fix

Add userdev-backed data source hashes to the NeoForge-specific cached binary-patch actions. binaryPatch now keys on the binary patch data source, and transformSources/applyDevTransforms key on the access-transformer data sources, matching the generic NeoForm data-placeholder behavior.

Tests

The regression tests model pairs of NeoForge userdev jars with the same NeoForm config, binpatcher command, sources jar, and universal jar while changing either embedded binary patch data or access-transformer data.

They assert that binaryPatch, transformSources, and applyDevTransforms cache keys change for their corresponding userdev data changes, and stay stable when the userdev contents are identical.

## Problem

The cached binary-patch path (`no-recompile` path) could reuse patched Minecraft artifacts built from an older NeoForge userdev jar.

`binaryPatch` keyed the clean Minecraft jar, binpatcher tool, and textual args, but not the userdev-embedded `patches.lzma` data that binpatcher applies to the clean jar.

The same issue existed for access transformers: `transformSources` and `applyDevTransforms` recorded data source IDs, but not the userdev-backed data contents. Changing the NeoForge userdev jar must invalidate these cache keys even when Minecraft/NeoForm inputs and tool args are unchanged.

## Observed Failure

NeoForge PR #3288 was released in NeoForge `26.2.0.10-beta`. It changed the `RenderArmEvent` proxy parameters and updated `ClientHooks.renderSpecificFirstPersonArm` to the new eight-argument signature:
neoforged/NeoForge#3288 (comment)

JEI then updated from NeoForge `26.2.0.6-beta`, which still used the old five-argument signature, to `26.2.0.11-beta`. CI reused cached `binaryPatch` and `applyDevTransforms` outputs while producing `26.2.0.11-beta` artifacts. The client recipe sync test loaded `minecraft-patched-26.2.0.11-beta.jar` with `neoforge-26.2.0.11-beta-universal.jar`, then crashed because the patched Minecraft jar still invoked the old `ClientHooks.renderSpecificFirstPersonArm` method.

This first surfaced in JEI 26.2 build 63:
https://ci.blamejared.com/job/mezz/job/jei/job/26.2/63/consoleText

## Fix

Add userdev-backed data source hashes to the NeoForge-specific cached binary-patch actions. `binaryPatch` now keys on the binary patch data source, and `transformSources`/`applyDevTransforms` key on the access-transformer data sources, matching the generic NeoForm data-placeholder behavior.

## Tests

The regression tests model pairs of NeoForge userdev jars with the same NeoForm config, binpatcher command, sources jar, and universal jar while changing either embedded binary patch data or access-transformer data.

They assert that `binaryPatch`, `transformSources`, and `applyDevTransforms` cache keys change for their corresponding userdev data changes, and stay stable when the userdev contents are identical.
@neoforged-pr-publishing

Copy link
Copy Markdown
  • Publish PR to GitHub Packages

@Technici4n

Copy link
Copy Markdown
Member

I'm surprised that this was not done before. I thought the data source system should already have handled this. 🤔

@mezz

mezz commented Jul 13, 2026

Copy link
Copy Markdown
Author

trying to do some git archareology to see some background on where the current state came from:

@mezz

mezz commented Jul 13, 2026

Copy link
Copy Markdown
Author

So for example, the addition here:

        ck.addStrings("access transformers data ids", accessTransformersData);
        ck.addPaths("additional access transformers", additionalAccessTransformers);

aa4f177#diff-862bc71488e496a3e6ffd97c9dd6909d7b96628deba9deea2ca8d83212c58a69R74-R75

these look like they'd do the same thing but only the addPaths one checks the contents of the ATs

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.

2 participants