Skip to content

fix(format): stabilize fingerprints without losing inherited changes - #1535

Open
joaodinissf wants to merge 1 commit into
dsldevkit:masterfrom
joaodinissf:codex/fix-format-fingerprints
Open

fix(format): stabilize fingerprints without losing inherited changes#1535
joaodinissf wants to merge 1 commit into
dsldevkit:masterfrom
joaodinissf:codex/fix-format-fingerprints

Conversation

@joaodinissf

@joaodinissf joaodinissf commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Saving a byte-identical .format file currently changes its exported fingerprints because they contain the parent EMF object's Java identity. In the reproducer, saving unchanged Xtype.format also reindexes its dependent Xbase.format.

Derive every fingerprint from source text and resource location, never from object identity. A local declaration is fingerprinted by its own token text; a format configuration is fingerprinted by the resource URI and complete source text of its own resource and of every configuration it transitively extends. The URI participates because the generated code records inherited source locations by file name, so renaming a base must regenerate its dependents. This keeps identical reloads stable while propagating real changes through an intermediate format without local declarations. Raw comments and delimiters participate because they affect generated source locations. Inheritance cycles terminate through a visited set, and an unresolved base contributes its proxy URI and ends the traversal, so it stays distinguishable from an absent base.

Add focused description regressions and a real Eclipse workspace test. The latter checks identical LF/CRLF saves, a content-preserving rename of a base, and compares all generated Java and trace bytes between incremental and full builds after constant, rule, declaration, comment and line-ending edits. The focused tests additionally cover empty configurations, cycles, unresolved/resolved bases, base selection and superclass changes. The independently runnable failing baseline is pinned in the issue.

Bump the Format bundle from 17.3.3 to 17.3.4 and the SDK feature from 19.2.0 to 19.2.1, including its update-site entry.

Closes #1534.

Validation on macOS/JDK 21:

  • Full CI-equivalent build (mvn clean verify checkstyle:check pmd:pmd pmd:cpd pmd:check pmd:cpd-check spotbugs:check) on the final commit: BUILD SUCCESS, 368 tests, 0 failures, 0 errors, 2 skipped; Checkstyle, PMD/CPD and SpotBugs clean.
  • The rename case was first run against a text-only fingerprint and failed (dependents kept // Xtype.format:N source comments and stale trace offsets), then passed once ancestor resource URIs entered the fingerprint. That run is what justifies the URI component.
  • Both focused description regressions and both workspace tests pass; the pre-fix baseline fails 7 of the 8 pre-existing regressions.

This addresses the demonstrated unnecessary rebuild propagation; it does not claim to reproduce or solve the reported endless Windows build loop.

Saving a byte-identical `.format` file changed its exported fingerprints,
because they contained the Java identity of the parent EMF object, which
differs on every reload. Dependent formats were reindexed and regenerated
although nothing had changed. In the reproducer, saving an unchanged
`Xtype.format` also reindexed its dependent `Xbase.format`.

Derive every fingerprint from source text and resource location, never from
object identity. A local declaration is fingerprinted by its own token text. A
format configuration is fingerprinted by the resource URI and complete source
text of its own resource and of every configuration it transitively extends, so an identical reload is stable while a real change
propagates through an intermediate format that declares nothing locally. Raw
comments and delimiters participate because they move the source locations
recorded in the generated code and traces. An inheritance cycle terminates
through a visited set; an unresolved base contributes its proxy URI and ends
the chain, so it is distinguishable from an absent base and a later resolution
changes the fingerprint exactly once.

Add focused description regressions and a real Eclipse workspace test. The
latter checks identical LF/CRLF saves, a content-preserving rename of a base,
and compares all generated Java and trace bytes between incremental and full
builds after constant, rule, declaration, comment and line-ending edits. The
focused tests additionally cover empty configurations, cycles, unresolved and
resolved bases, base selection and superclass changes.

Bump the Format bundle from 17.3.3 to 17.3.4 and the SDK feature from 19.2.0
to 19.2.1, including its update-site entry.

Closes dsldevkit#1534.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@joaodinissf
joaodinissf force-pushed the codex/fix-format-fingerprints branch from fe8a1b2 to c2cddf5 Compare September 11, 2026 16:55
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.

Format fingerprints change on identical reloads and trigger dependent rebuilds

1 participant