Check queue experiment#10708
Draft
timotheeguerin wants to merge 11 commits into
Draft
Conversation
Add DeferralSignal class for stack-unwinding deferral, global-retry fixpoint loop in processUntilFixpoint, PendingResolutions snapshot/restore, and maybeDeferOnQueuedDeclaration helper. Infrastructure is ready but not yet wired to cycle detection points (needs incremental activation). - DeferralSignal thrown when check encounters unresolved dependency - activeItem tracking on CheckQueue for queue-aware checks - Global retry: re-queues all deferred items when progress is made - PendingResolutions snapshot/restore for clean rollback on deferral - markError accepts Deferred items for force-checking cycles - 33 queue unit tests, 1390 checker tests pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the check queue reaches fixpoint with remaining deferred items, use Tarjan's SCC analysis to identify cycle groups and report a 'circular-dependency-cycle' diagnostic listing all participants before force-checking them for per-site error diagnostics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add infrastructure for the two-pass (shell creation + population) type checking approach. This is preparatory work for enabling queue-based deferral: - Add allItems() iterator to CheckQueue for traversing all registered items - Add createDeclarationShells() with per-type shell creation functions (Model, Scalar, Interface, Union, Operation, Enum) - Shells are minimal type objects created via createType() with creating=true that can be referenced before full population NOTE: Shell creation is currently DISABLED (commented out in checkProgram) because it breaks the existing pendingResolutions-based cycle detection. When shells exist, cross-references resolve immediately via symbolLinks.declaredType without triggering DFS into the target's check function, so pendingResolutions tracking never fires for the target. Activating this requires redesigning cycle detection to work across queue iterations rather than within a single DFS call stack. Options: 1. Track extends/is chains explicitly in the queue 2. Use the queue's SCC analysis as the primary cycle detector 3. Add a pre-check AST dependency analysis pass All 1390 checker tests + 33 queue tests continue to pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
❌ There is undocummented changes. Run The following packages have changes but are not documented.
Show changes |
|
You can try these changes here
|
…references
When a member access (e.g., A.t) targets a model that is still being
checked (creating=true), defer the resolution using the existing
waitingForResolution callback mechanism instead of emitting an error.
When the container type finishes checking, the callback re-resolves
the member via late-bound symbols and updates the property type.
This enables patterns like:
model Template<T> {...T}
model A is Template<{t: B}>;
model B { a: A.t; }
Where B.a references A.t which only becomes available after A's
template instantiation completes.
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.
No description provided.