Skip to content

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

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

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

Closes #1534

Why the change

Saving an unchanged .format file no longer changes its fingerprints, so the format files that extend it are no longer re-indexed, while real changes still propagate through inheritance.

Special things to note

  • A fingerprint now combines the resource URI with the full source text of the configuration and of every configuration it extends. The URI is part of it because generated code records inherited source locations by file name, so renaming a base must regenerate its dependents; a text-only fingerprint failed that case.
  • Computing a configuration's fingerprint resolves its with reference during indexing, and a configuration is now exported under its fingerprint, as its declarations already were.
  • This removes the demonstrated unnecessary rebuild propagation. It does not claim to fix the reported endless Windows build loop.

Change outline

 fingerprint(declaration)
-  includes the parent EMF object's identity          # differs on every reload
+  its own token text, comments and delimiters included
 fingerprint(format configuration)
+  resource URI + complete source text, for itself and every configuration it extends
+  cycle-guarded; an unresolved base contributes its proxy URI and ends the walk
 com.avaloq.tools.ddk.xtext.format/
   resource/FormatResourceDescriptionStrategy.java   # the fingerprints above; bundle 17.3.3 → 17.3.4
 com.avaloq.tools.ddk.xtext.format.test/
+  resource/FormatResourceDescriptionStrategyTest.java   # 8 tests: reloads, cycles, bases, proxy URI
+  builder/FormatIncrementalBuildTest.java               # workspace: LF/CRLF saves, base rename, incremental = full build output

🤖 Generated with Claude Code

@joaodinissf
joaodinissf force-pushed the codex/fix-format-fingerprints branch from fe8a1b2 to c2cddf5 Compare September 11, 2026 16:55
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 a focused test class (eight tests) 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaodinissf
joaodinissf force-pushed the codex/fix-format-fingerprints branch from c2cddf5 to 065b3d5 Compare September 22, 2026 22:19
@joaodinissf
joaodinissf marked this pull request as draft September 22, 2026 22:19

This branch has not been deployed

No deployments
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