Use Codex patricia-tree library for base map domain#2002
Use Codex patricia-tree library for base map domain#2002
Conversation
|
For flow-sensitive analysis of rsync, this reduces the analysis time from ~9h 23min to ~7h 17min, which is about -22% (goblint/bench@7f22f21). Around 20% of the time is still spent on GC. A lot of time is still spent in the inner I'm now also doing a run on sv-benchmarks although I don't expect much change there. |
|
I was confused about what Codex had to do with it, but then realized it's the Lemerre et al. Codex. For anyone also confused: https://codex.top/. |
There's a lot more than I expected. I did before vs after runs with level01 with 60s and 1GB. There's ~53 new trues: https://goblint.cs.ut.ee/results/328-all-level01-pr-2002-before/table-generator-cmp.diff.html#/table?filter=0(0*status*(status(notIn()),category(notIn()))),1(0*status*(status(notIn()),category(in(correct)))). Some are borderline noise flips, but some are due to significant differences. CPU timeAverage 9% improvement, up to 2×: Memory |
|
There's also one we lose that is unrelated to timing changes. Maybe worth taking a look, I guess this should behave exactly as the old one apart from runtime / memory concerns. |
I also noticed that. It's from #1984 (comment). |
To fix tests where the inner operator is nonidempotent due to int domain refinement.


Closes #1967.
During the AnalyzeThat 2026 workshop the Codex team told us that they have specifically published on opam the patricia-tree library which provides efficient merging with idempotent operators. This is an attempt to use it for the map domain in the base analysis.
I noticed that some part of Frama-C is also possibly switching to this library: https://git.frama-c.com/pub/frama-c/-/merge_requests/18.
Note that the library doesn't completely replace
Stdlib.Map.Make: patricia-tree requires keys to have uniqueintvalues.Luckily, base analysis map domain has
varinfos which havevid, so it should work.But we have plenty of other usages of
MapDomainwith more complex keys, so this PR tries to generalizeMapDomainto allow both to be used.Apparently this causes one test with int domain refinement and narrowing to fail again because the
narrowis not idempotent.TODO
meetandnarrowdue to possible int domain refinement issues for now.