Skip to content

Read the arrays of a shared function or record only of a snapshot. - #139

Merged
lemmy merged 1 commit into
masterfrom
mku-gh1445
Oct 26, 2026
Merged

lemmy merged 1 commit into
masterfrom
mku-gh1445

Conversation

@lemmy

@lemmy lemmy commented Oct 24, 2026

Copy link
Copy Markdown
Member

TLC sorts a FcnRcdValue or RecordValue in place the first time it needs it sorted. An override that reads its arrays while another worker sorts it may miss an element or see one twice. The overrides now read the arrays of a snapshot(), as TLC's own modules do.

Part of Github issue #1445
tlaplus/tlaplus#1445

[Bug]

TLC sorts a FcnRcdValue or RecordValue in place the first time it needs
it sorted. An override that reads its arrays while another worker sorts
it may miss an element or see one twice. The overrides now read the
arrays of a snapshot(), as TLC's own modules do.

Part of Github issue #1445
tlaplus/tlaplus#1445

[Bug]

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
@lemmy lemmy self-assigned this Oct 24, 2026
@lemmy lemmy added the bug Something isn't working label Oct 24, 2026
@lemmy
lemmy marked this pull request as ready for review October 26, 2026 21:26
@lemmy
lemmy requested a balanced review from Copilot October 26, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused changes follow TLC’s snapshot contract, with no identified blocking defects.

No open issues 🎉

What changed in this PR

This PR protects CommunityModules overrides from concurrent in-place sorting by TLC workers by reading function and record arrays through snapshots.

Changes:

  • Uses snapshots for serialization, SVG rendering, environment conversion, injectivity checks, and bag folding.
  • Removes explicit normalization from JSON function-array conversion.
  • Reuses the local element reference in LongestCommonPrefix.
File Description
modules/​tlc2/​overrides/​SVG.java Snapshots attributes and record/function children before reading arrays.
modules/​tlc2/​overrides/​SequencesExt.java Uses the local element reference for the empty-set check.
modules/​tlc2/​overrides/​Json.java Serializes function and record snapshots without explicit array-path normalization.
modules/​tlc2/​overrides/​IOUtils.java Snapshots environment records before conversion.
modules/​tlc2/​overrides/​Functions.java Checks injectivity using snapshot values.
modules/​tlc2/​overrides/​CBOR.java Snapshots functions before encoding.
modules/​tlc2/​overrides/​BagsExt.java Snapshots bags before reading domain and value arrays.

Review effort: Balanced

@lemmy
lemmy merged commit 1805e9d into master Oct 26, 2026
9 of 12 checks passed
@lemmy
lemmy deleted the mku-gh1445 branch October 26, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants