Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

Background precomputation for deep view chains - #412

Merged
github-actions[bot] merged 1 commit into
mainlinefrom
background-view-precomputation
Mar 19, 2026
Merged

Background precomputation for deep view chains#412
github-actions[bot] merged 1 commit into
mainlinefrom
background-view-precomputation

Conversation

@shiba4life

Copy link
Copy Markdown
Collaborator

Summary

  • Views deeper than level 1 (depending on other views) now precompute in background tasks after source mutations
  • New ViewCacheState::Computing state — queries return "not ready" error until precomputation finishes
  • Single-pass cascade invalidation replaces per-step lock re-acquisition (perf improvement from view_chain_performance.md mitigations Update node docs #1 and Add manual cross-schema transform test #3)
  • Background task computes views bottom-up (leaves first), resets to Empty on failure

State machine

Empty ──(bg task)──▶ Computing ──(done)──▶ Cached
  ▲                                          │
  └──────────(invalidate)────────────────────┘

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo test --workspace --all-targets — all pass (including existing view chain tests)
  • Manual test: register 3-level view chain, mutate source, verify Computing state, verify Cached after precomputation

🤖 Generated with Claude Code

Views deeper than level 1 (depending on other views) now precompute
in background tasks instead of lazily on query. New ViewCacheState::
Computing state indicates precomputation is in progress — queries
return a clear "not ready" error until it finishes.

On source mutation:
- Single-pass cascade collection (replaces per-step lock re-acquisition)
- Deep views marked Computing, background task computes bottom-up
- If precomputation fails, resets to Empty for lazy fallback

Also removes the old recursive invalidate_cascading_view_caches in
favor of synchronous collect_cascade_views (single lock acquisition).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions
github-actions Bot enabled auto-merge (squash) March 19, 2026 18:03
@github-actions
github-actions Bot merged commit 432169a into mainline Mar 19, 2026
3 checks passed
@github-actions
github-actions Bot deleted the background-view-precomputation branch March 19, 2026 18:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant