Repository navigation
fix(types): traverse deep graphs without recursive Go calls - #76
Merged
Merged
Conversation
wolfy-j
marked this pull request as ready for review
October 17, 2026 20:05
wolfy-j
changed the base branch from
fix/lint-structural-type-comparison
to
main
October 19, 2026 15:11
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.
After #75 removes the old traversal depth cutoff, softness detection and return-type scanning still recurse on the Go stack. A standalone graph of 20,000 nested arrays exhausts a deliberately reduced 1 MiB stack budget.
Use traversal-local work lists instead of recursive Go calls. Softness is completed in postorder, preserving cycle rejection and cached results for shared subtrees. Return scanning retains depth-first child order, early matches and predicate-controlled pruning. Existing identity maps still ensure each shared node is traversed once; no depth cutoff or persistent cache is added.
This PR is stacked on #75 and should land after it or be folded into it.
Validation:
go test -timeout 25m ./...passes in Linux CI.go test ./types/typ ./compiler/check/returns -race -count=1