Skip to content

fix(types): traverse deep graphs without recursive Go calls - #76

Merged
wolfy-j merged 2 commits into
mainfrom
fix/stack-safe-type-walks
Oct 19, 2026
Merged

wolfy-j merged 2 commits into
mainfrom
fix/stack-safe-type-walks

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Both reduced-stack subprocess regressions fail before the fix and pass afterward.
  • Covers terminal placeholder/concrete evidence, cycles, shared results, scan order and incomplete method declarations.
  • Full go test -timeout 25m ./... passes in Linux CI.
  • go test ./types/typ ./compiler/check/returns -race -count=1

@wolfy-j
wolfy-j marked this pull request as ready for review October 17, 2026 20:05
@wolfy-j
wolfy-j changed the base branch from fix/lint-structural-type-comparison to main October 19, 2026 15:11
@wolfy-j
wolfy-j merged commit 0937629 into main Oct 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant