Refactor bot of threadJoins analysis to mean uncomputed#1977
Conversation
Invalid_widen in MustThreadSet by replacing Reverse(ThreadSet) with Reverse(ToppedSet(FlagConfiguredTID))
|
This hopefully fixes all the issues in the forward solver (the AI version did, I just re-structured code from that a little to get less duplication). |
Invalid_widen in MustThreadSet by replacing Reverse(ThreadSet) with Reverse(ToppedSet(FlagConfiguredTID))MustThreadSet: Replace Reverse(ThreadSet) with Reverse(ToppedSet(FlagConfiguredTID))
There was a problem hiding this comment.
Pull request overview
This PR updates the must-joined threads domain to avoid Lattice.Invalid_widen in the bu solver when threadJoins is enabled by replacing the prior “{UnknownThread} as bot” encoding with a proper reversed topped set over FlagConfiguredTID.
Changes:
- Redefine
ConcDomain.MustThreadSetasReverse (ToppedSet FlagConfiguredTID)to give a coherent bottom/top meaning for must-joined semantics. - Adapt downstream analyses to pattern-match
Thread ftand operate onFlagConfiguredTID.telements. - Introduce
ThreadSet.diff_mustsetto subtract aMustThreadSetfrom aThreadSetin call sites that previously usedThreadSet.diff.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cdomain/value/cdomains/concDomain.ml | Redefines MustThreadSet and adds ThreadSet.diff_mustset helper. |
| src/cdomains/mHP.ml | Switches MHP state to MustThreadSet and updates membership/existence logic accordingly. |
| src/analyses/threadJoins.ml | Updates join/clean logic to use MustThreadSet element type and reversed lattice semantics. |
| src/analyses/useAfterFree.ml | Adjusts must-joined membership check to unwrap Thread ft. |
| src/analyses/threadId.ml | Uses diff_mustset when checking “single-threaded” based on joined threads. |
| src/analyses/mHPAnalysis.ml | Updates printing predicate to use MustThreadSet. |
| src/analyses/creationLockset.ml | Uses diff_mustset to remove must-joined tids from possibly-running sets. |
| src/analyses/basePriv.ml | Uses diff_mustset to avoid re-joining already must-joined threads in forced join path. |
| src/analyses/apron/relationPriv.apron.ml | Mirrors basePriv.ml change for Apron relation privatization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This is now much more refactoring than I had hoped to do, but it should be a clean solution. |
37834dc to
c2009b5
Compare
…uredTID Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/dc6171b9-ab25-4a8e-a837-2904adb70c71 Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
3f57e11 to
8dbff69
Compare
MustThreadSet: Replace Reverse(ThreadSet) with Reverse(ToppedSet(FlagConfiguredTID))bot of threadJoins analysis to mean uncomputed
sim642
left a comment
There was a problem hiding this comment.
I force pushed a bit of interactive rebase here to clean up the Copilot history a bit but keep the manual parts still separate (instead of squashing everything).
The
busolver triggersLattice.Invalid_widenwhenthreadJoinsis active becauseman.global tidreturnsbot()before contributions arrive — andMustThreadSet.bot()was{UnknownThread}. Widening then fails becauseleqdoesn't treatUnknownThreadas a universal element in the reversed lattice.Core change
UnknownThreadfrom the element type entirely; elements are nowFlagConfiguredTID.tbot()becomes the properTopsentinel (all threads must-joined = unreachable), not the semantically broken{UnknownThread}leq/ widening by eliminating the element that had no coherent must-join semantics