Skip to content

perf(v3): defer lazy root proof during workspace admission - #216

Merged
genedna merged 8 commits into
mainfrom
perf/v3-lazy-root-admission-rebased
Nov 20, 2026
Merged

genedna merged 8 commits into
mainfrom
perf/v3-lazy-root-admission-rebased

Conversation

@Ivanbeethoven

Copy link
Copy Markdown
Collaborator

Problem

Creating a lazy v3 workspace currently proves the entire root metadata page before the mount is exposed. On wide monorepos this makes admission latency scale with root size and duplicates the first namespace access.

Change

  • Defer root metadata proof for WorkspaceDelivery::Lazy until the first namespace operation.
  • Keep full delivery eager so root failures remain visible during create.
  • Add regression coverage for lazy admission with zero metadata-page requests and preserve eager failure cases.

This is v3-only behavior and contains no legacy protocol fallback or benchmark artifacts.

Validation

  • cargo fmt -- --check (stable; passes)
  • git diff --check (passes)
  • Linux cargo tests are required for final CI validation; Windows cannot compile the Unix FUSE dependency in this checkout.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T08:36:07.970681Z aaca9f7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 834df63004

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/workspace/service.rs
Comment on lines +490 to +493
(if matches!(request.delivery, WorkspaceDelivery::Lazy) {
trace_async(
"root_metadata_bind",
Mst2Fuse::from_reader_lazy_deferred(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the remaining eager-failure fixtures

For a denied root with delivery: lazy, this branch now skips the request that produced the expected error and successfully mounts the workspace, as the new regression test demonstrates. However, opted_in_read_checkpoints_are_bounded_owner_specific_and_do_not_change_strict_status (tests/mst2_workspace_v3_http.rs:483-488) and destroying_failed_preparation_retires_unknown_cache_use_without_private_directories (tests/mst2_workspace_v3_http.rs:803-816) still submit lazy requests and require a 500 response plus failed/no-mount state, so both tests will deterministically fail on Linux; make those remaining eager-failure fixtures use full delivery or rewrite their assertions for successful lazy admission.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a416ade01

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/snapshot/fuse.rs Outdated
owner_guard.finish(result.clone());
result
} else {
let notified = gate.notify.notified();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Register the directory waiter before checking the result

When concurrent first accesses load the same directory on different executor threads, the owner can set result and call notify_waiters() after this waiter observes None but before its Notified future is first polled. Tokio does not retain a notify_waiters() permit for an unregistered future, so this waiter can sleep forever and indefinitely hang the FUSE operation. Pin and enable the notification future before checking result, or use a primitive that atomically publishes and observes completion.

Useful? React with 👍 / 👎.

@genedna
genedna force-pushed the perf/v3-lazy-root-admission-rebased branch from 1103d48 to aaca9f7 Compare November 20, 2026 08:34
@genedna
genedna merged commit e1c59a8 into main Nov 20, 2026
14 checks passed
@genedna
genedna deleted the perf/v3-lazy-root-admission-rebased branch November 20, 2026 08:52
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.

2 participants