Skip to content

Performance Series 2 (3/5): Incremental taclet re-indexing for a single added taclet#3876

Merged
unp1 merged 1 commit into
mainfrom
bubel/reindex-fastpath
Jul 4, 2026
Merged

Performance Series 2 (3/5): Incremental taclet re-indexing for a single added taclet#3876
unp1 merged 1 commit into
mainfrom
bubel/reindex-fastpath

Conversation

@unp1

@unp1 unp1 commented Jun 30, 2026

Copy link
Copy Markdown
Member

Intended Change

Each time a single taclet is added to a goal, TacletAppIndex rebuilt its rule-application index over the entire taclet set. This change re-indexes only the one newly added taclet, via a small one-taclet index, instead of rebuilding everything. Behaviour-preserving.

Benchmark

Automode time, median of 3 runs, serial forks (-PrapForks=1), isolated user.home per run; baseline = current main (8 representative proofs: 4 quantifier-heavy + 4 mixed). ArrayList.remove.1 is high-variance run-to-run — treat as noise.

proof baseline (ms) this PR (ms) Δ
PUZ031p1 13712 12808 -7%
SimplifiedLinkedList.remove 17469 17412 -0%
Saddleback 13026 12341 -5%
SYN550p1 821 782 -5%
symmArray 12737 11195 -12%
gemplusDecimal 8378 8161 -3%
coincidence 2181 2161 -1%
ArrayList.remove.1 3339 2448 -27%
TOTAL 71663 67308 -6%

Plan

  • Add a focused per-PR benchmark to this description
  • Mark ready for review once the Performance Series 2 determinism gate passes (see overview)

Type of pull request

  • Refactoring (behaviour should not change or only minimally change)
  • There are changes to the (Java) code

Ensuring quality

  • I made sure that introduced/changed code is well documented (javadoc and inline comments).
  • I have checked that runtime performance has not deteriorated.

Additional information and contact(s)

Part of Performance Series 2 — see the overview (#3879) for the combined benchmark and series context.

Created with AI tooling support.

The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.

@unp1 unp1 self-assigned this Jun 30, 2026
@unp1 unp1 changed the title TacletAppIndex: re-index a single added taclet via a one-taclet index Performance Series 2 (3/5): Incremental taclet re-indexing for a single added taclet Jun 30, 2026
@unp1 unp1 force-pushed the bubel/reindex-fastpath branch from c1e2a8d to 6be6cea Compare June 30, 2026 18:24
When a NoPosTacletApp is added, addedNoPosTacletApp re-walks the affected
formulas and, at every position, fetched that position's full operator
taclet list and filtered it through a SetRuleFilter to keep the single new
taclet. For common operators that list is large, so this membership scan
dominated re-indexing (~12.8% of CPU on the wide-branching bike example;
60.7% of all HashMap lookups).

Instead, feed the walk a one-taclet index built from just the new taclet,
reusing the identical getList/match logic, so matchTaclets iterates ~one
candidate per position. The single-threaded index is used deliberately:
the multi-threaded matcher only parallelizes above 256 taclets, so a
one-taclet index always takes its sequential path anyway.

Byte-identical -- the multi-taclet addedNoPosTacletApps path is unchanged.
New differential + unit tests in TestTermTacletAppIndex compare the
mini-index re-index against the SetRuleFilter path (identical fired apps
and apps at every position); full testRAP is green. On bike this cuts
automode time ~16% (HashMap.getNode 12.1% -> 4.9%).

Created with AI tooling support
@unp1 unp1 force-pushed the bubel/reindex-fastpath branch from 6be6cea to 9bf03e2 Compare June 30, 2026 21:33
@unp1 unp1 marked this pull request as ready for review July 1, 2026 07:20

@Drodt Drodt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@unp1 unp1 added this pull request to the merge queue Jul 4, 2026
Merged via the queue into main with commit ec1708e Jul 4, 2026
36 checks passed
@unp1 unp1 deleted the bubel/reindex-fastpath branch July 4, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants