Repository navigation
Make operation validation iterative and fix fragment-chain stack overflows - #4545
Merged
Merged
Conversation
andimarek
marked this pull request as ready for review
November 7, 2026 23:43
Contributor
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (7 classes)
|
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.
A valid operation can pass the default parser limits yet overflow a 1 MiB Java thread stack when it follows 1,501 fragment definitions, even with only two field levels.
Changes
OperationValidatorone iterativevalidate()entry point for AST traversal and operation-scoped fragment expansion. RemoveLanguageTraversalandDocumentVisitor; migrate tests and benchmarks.@deferscope.Validation
./gradlew test check: 6,095 tests, 7 expected skips, no failures; build checks pass.-Xss1m, including the fragment-stack regressions.StackOverflowError; all pass with this change.Performance
The existing
GoodFaithValidationBenchmark.validatewithscenario=fragmentHeavyvalidates 1,000 aliased selections using shared nested fragments. Parsing and schema construction are outside the timed method.Hetzner Ryzen 5 3600; Java 25, ZGC, fixed 4 GiB heap and 1 MiB stack. Identical dependencies and benchmark bytecode; three forks per version, 10 × 10-second warmup and 5 × 10-second measurement iterations, with the JMH GC profiler. CPU/allocation profiles were recorded separately.
d5e7c26c3These are the final runs after three profiling/optimization rounds, including a fresh baseline run. Every candidate fork averaged faster than every baseline fork. This measures one validation workload; it does not measure execution-side field collection or establish results for every query.