Repository navigation
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>
DeusData
left a comment
There was a problem hiding this comment.
Thank you, @dianshu. This is exactly the shape we hoped for. Dropping the work budget and letting the shallower-revisit rule plus the depth guard bound the walk means no CALLS edge can quietly vanish because a counter ran out. Growing the visited table, with a logged failure instead of a silent truncation, closes a second, subtler cap we hadn't even called out. The seam counters are a real improvement too: both cycle tests now decide their verdict on a proven bound instead of a 30-second clock, and the branching test finally runs on Windows.
One optional thought, not a condition: if the visited logic ever regressed, the branching test would hang rather than go red, because the walk becomes exponential. A seams-only "exceeded" latch that stops the walk, and that the test asserts is false, would make that failure fast and explicit. Happy to take it as it is either way. Approving, thanks again for the careful work!
|
Thanks for approving. The macOS Intel job failed in |
|
Thank you, @dianshu, and sorry you hit this. The macOS Intel failure in |
|
Hi @DeusData, CI is green, but GitHub now shows merge conflicts with |
Merge upstream main at 92b2dd1 while preserving the per-lookup depth and visited-state guards for TypeScript member and method lookup. 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