Conversation
Signed-off-by: dianshu <dianshu@123.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
DeusData
left a comment
There was a problem hiding this comment.
Thank you — replacing the shared member_depth guard with per-lookup state (a depth limit, plus a visited table that re-enters a type only at a shallower depth) is the right structure, and it closes the cycle blow-up cleanly.
Two things before it merges, both from standing rules of the codebase:
- The 4096-step budget silently decides graph content. When it runs out, the lookup returns UNKNOWN with no log or counter, and a CALLS edge disappears without a trace. Our rule is that no work cap may silently decide what lands in the graph. Here the visited table already bounds the work (each type is re-entered at most once per shallower depth, so at most 64 times), so the budget looks redundant: please drop it. If you find a case it is still needed for, make hitting it loud, with a counter or log line that a test asserts on.
- A timeout must not decide a test verdict.
lsp_ts_branching_cycle_has_bounded_workandlsp_ts_cyclic_types_no_crashpass or fail on thealarm(30)watchdog. Please replace that with a deterministic work counter exposed behindCBM_ENABLE_TEST_SEAMS, and assert it stays within the proven bound. That also lets the branching test run on Windows instead of being skipped.
The shallower-revisit test is a good guard for the visited-depth logic. Thank you again.
Signed-off-by: dianshu <dianshu@123.com>
What does this PR do?
Bounds recursive TypeScript member and method lookup on cyclic and highly
branching type graphs.
reached first through a deeper path to be reconsidered through a shallower
path;
member_depthfield;methods, and shallower revisits.
Before this change, a cyclic type graph could overflow the ASan stack, while a
depth-only guard still allowed branching cyclic graphs to exceed the 30-second
test watchdog.
This contribution was prepared with AI assistance and reviewed and submitted
by the human account owner.
Verification
scripts/test.sh: 8172 passed, 0 failed, 8 skippedscripts/test.sh --suites "ts_lsp stack_overflow_b"(313 passed). Before the fix,lsp_ts_cyclic_types_no_crashoverflowed the ASan stack; a depth-only guard still causedlsp_ts_branching_cycle_has_bounded_workto exceed its 30-second watchdog.make -f Makefile.cbm lint-format CLANG_FORMAT=clang-format-20git diff --checkChecklist