Repository navigation
Read the arrays of a shared function or record only of a snapshot. - #139
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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]