Repository navigation
Terminate TypeScript hierarchy walks on inheritance cycles - #519
Merged
Merged
Conversation
CaelmBleidd
force-pushed
the
caelmbleidd/ts-cycle-safe-hierarchy
branch
from
October 15, 2026 14:07
7133148 to
cfa4d0c
Compare
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 real
BinarySearchTreeclass from the 200-class startup screen never reached symbolic execution: its main thread spent 47.94 CPU seconds inEtsHierarchywhile constructing the initial state, then hit the 60-second child timeout. The original TypeScript declares both an interface and a class namedBinarySearchTree, withclass BinarySearchTree extends BaseCollection implements BinarySearchTree. Once #517 resolves those merged declarations, that interface reference resolves to the canonical runtime class itself. The previous unbounded ancestry sequence followed this self-reference forever.Compute ancestry with a work queue and a visited set instead. Each reachable class is expanded once, including cycles through superclass or interface edges. The resulting ancestor and inheritor sets retain the starting class, every reachable parent, and the existing SDK
Objectbehavior. Resolution rules are unchanged: an unknown-file name still explores every matching candidate; missing exact signatures and duplicate runtime declarations still fail.This change is independent of #517 and targets
main; apply both to address the merged-declaration startup case. No experiment driver, frontend, dependency pin, or model changes are included.Validation: eight focused
EtsHierarchyTestcases passed (self-reference, mutual class/interface cycles, diamond, same-name candidates, exact signatures, and ambiguity failures);:usvm-ts:detektMain,:usvm-ts:detektTest, andgit diff --checkpassed. The original saved frontend IR and thread dump establish the reported cause. The machine and full test suite were not rerun in this change.Refs #487.