Repository navigation
Conversation
A search's walk marks, per view and in its own child order, whether a variable child is the first occurrence of its name in the pattern, and binds such an occurrence straight away; later occurrences, a multi-pattern's clauses and a client's matchIn with a substitution ask as before, and a pattern node object at two positions turns the marks off. Same Subst objects, same chain and match order; Matcher.searchAsking keeps the asking walk as the oracle, and MatcherMarksTest compares the two match by match. Generated-by: Claude Code (Claude Fable 5.1)
This was referenced Nov 22, 2026
MaxGekk
pushed a commit
that referenced
this pull request
Nov 22, 2026
Generated-by: Claude Code (Claude Fable 5.1)
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.
What changes were proposed in this pull request?
Closes #149.
The matcher's walk no longer asks the substitution for a variable it knows is unbound.
Matcher.matchInwith a substitution ask at every occurrence, as before. A pattern that uses one node object at two positions turns the marks off for that search.Substobjects, their chain order and the match order are the same as before.Matcher.searchAskingkeeps the old walk, andMatcherMarksTestcompares the two walks match by match on math and prop saturations, including the order of each substitution's bindings.Why are the changes needed?
Subst.nodeOfInternedis the top self frame of math's run (12 to 14% of the samples) and 9% of prop's. A count over 60 fuzz terms per language showed why: the walk askedidOrUnbound4.7 million times on prop and got "unbound" back 89% of the time, each followed by abindNew. The chains are short; the calls are the cost.Does this PR introduce any user-facing change?
No. The matches, their order and their bindings are the same. The pinned suites pass and the determinism rendering is byte for byte main's.
How was this patch tested?
MatcherMarksTest, new: both walks over every rule of math and prop on 24 saturated graphs, compared match by match and binding order by binding order; a variable first met inside a nested node and asked for at the sibling after; a node object used twice, which falls back to asking.compare-19(a first run, 45033330977, failed on a Maven Central rate limit before the fuzz ran); the probe, run 45033354838,probe-18, every counter of every term the same as The rebuild repairs the absorbed side's parents alone, congruence through the hashcons #136's; the Timing against main, run 45033334153,timing-10.Predictions from #149:
idOrUnboundanswered unbound falls under 5% of its former number: failed by the number. prop 4,671,757 to 695,290 (15%), math 4,244,273 to 911,218 (21%). What remains is the ground checks of nested nodes (isGround), which ask about every variable of a nested node before the walk reaches it, and the multi-pattern clauses.nodeOfInterned's self share falls by half on prop and a third on math: failed. prop 8.7% to 9.9%, math 14.3% to 13.9%, lambda 10.8% (jfr view hot-methodsonprobe-9andprobe-18). The method is inlined into the walk's loop; the profiler charges it with the loop's samples, and 85% fewer calls did not move it.faster: failed. prop +0.1%, math +2.3%, within noise.By #149's exit clause, this closes with no code: the calls were not the cost. The lesson is on PR #151, "A profile's share is not a count". Recommendation: close unmerged.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5.1)