Skip to content

fix: stabilize incremental inference and index ownership - #89

Open
Pollux12 wants to merge 160 commits into
mainfrom
fix/index-regressions
Open

fix: stabilize incremental inference and index ownership#89
Pollux12 wants to merge 160 commits into
mainfrom
fix/index-regressions

Conversation

@Pollux12

@Pollux12 Pollux12 commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Make declaration writes resolve consistently by source order instead of analysis arrival order.
  • Preserve and reattach cross-file members when partial re-indexing prunes their visible owner slots.
  • Keep inferred types, narrowing, dynamic fields, realm members, and dependent caches stable across incremental edits and re-analysis.
  • Add broad regression coverage for inference, diagnostics, completions, incremental edits, and cross-file index behavior.
  • Update determinism, latency, and repository guidance for the new analysis and verification paths.

Testing

  • Added regression tests across glua_code_analysis for declaration inference, member ownership, flow narrowing, type checks, diagnostics, and incremental edits.
  • Added completion coverage in glua_ls and isolated progress tests from concurrent analysis.
  • Updated determinism and LSP latency tooling to cover incremental and cancellation behavior.
  • Not run: full workspace test suite, clippy, release determinism corpus, and large-workspace benchmark.

Greptile Summary

This PR substantially reworks incremental inference, index ownership, cache invalidation, and LSP analysis coordination to keep semantic results stable across edits and re-analysis.

  • Makes declaration and member writes deterministic by source order.
  • Preserves cross-file ownership and inferred semantic state during partial re-indexing.
  • Adds extensive regression coverage for inference, diagnostics, completions, edits, and determinism.
  • Vendors a patched Rowan implementation to improve syntax-tree behavior on small stacks.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/glua_code_analysis/src/lib.rs Expands top-level incremental workspace orchestration and integration with the revised analysis and index lifecycle.
crates/glua_code_analysis/src/compilation/analyzer/mod.rs Reworks analyzer phase coordination, inference stabilization, and incremental analysis behavior.
crates/glua_code_analysis/src/db_index/member/mod.rs Redesigns member ownership and contribution handling to preserve deterministic cross-file state.
crates/glua_code_analysis/src/db_index/edit/export_map.rs Adds edit-aware export mapping used to retain and translate indexed state across source changes.
crates/glua_code_analysis/src/inferred_guard.rs Introduces shared guard logic for maintaining inferred data safely across analysis operations.
crates/glua_ls/src/context/debounced_analysis.rs Revises debounced analysis, cancellation, and snapshot coordination for incremental LSP updates.
vendor/rowan/src/green/node.rs Vendors Rowan tree-management behavior to avoid problematic recursive operations on small stacks.
tools/determinism/src/main.rs Broadens determinism tooling to exercise incremental and cancellation-sensitive analysis paths.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Edit[Workspace edit] --> VFS[VFS and position mapping]
  VFS --> Reindex[Partial re-index]
  Reindex --> Ownership[Member and declaration ownership]
  Ownership --> Infer[Incremental inference]
  Infer --> Cache[Dependent cache invalidation]
  Cache --> Semantic[Semantic snapshot]
  Semantic --> LSP[Diagnostics, completion, hover]
Loading

Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/index-regre..." | Re-trigger Greptile

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