← Back to Pull requests

Keep a volume's attributes for a second, filled from listings #2

Closed
unknown closed this pull request without merging on Nov 27, 2026 18:51 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 05:19 UTC
Author

Every lookup in a volume was one HTTP request from the page to the supervisor, and the guest asks often. For one cat, the 9p server asks for the attributes on the walk, on Tlopen, and once more inside volumeFs.open. A program that lists a directory then stats each name in it: find, a compiler, a module resolver. The listing already carries every entry's attributes (rootfs.Entry.Attr), but volumeFs.readdir dropped them.

Change

volumeFs keeps attributes for VOLUME_KEEP_MS (1 s):

  • From listings: readdir keeps the attributes the listing already sends.

  • Shared requests: an attribute question is kept as a promise, so questions that arrive together share one request.

  • Errors: ENOENT is kept as an answer, since a search asks after many names that do not exist. Any other error is forgotten.

  • Guest changes: every change made through the volume clears everything, before and after the request. The guest sees its own changes at once.

  • Races: a listing that was in flight across a change is not kept.

  • Memory: the map is dropped once a second, so a walk over a huge tree keeps about a second's worth of names, not all of them.

  • Not cached: contents. Every read is still a request.
  • A change made on the host shows within the second, plus the guest kernel's own metatimeout of 1 s: about 2 s in all. That is the same order as what the SDK's own host mounts promise.

    Measurements

    The same go build and share (unkernel 0.2.0-261125-cec0a49), on macOS (M-series). Only page/guest.js was swapped between main and this branch, alternating per run. The volume is a real Nuxt app's node_modules (56,795 files), mounted read-only.

    | Test | main | this branch |
    | --- | --- | --- |
    | find /v -type f \| wc -l (57k files) | 69.3, 58.5, 57.5, 57.9, 55.3 s | 13.3, 12.9, 12.7, 12.6, 12.4 s |
    | cat all files of nuxt, vite, @nuxt (25.7 MB) | 6.5, 6.1, 6.1, 6.4, 6.1 s | 3.1 s in all 5 runs |
    | 2,000 echo > fN into a read-write volume | 5.8, 5.7, 5.7 s | 4.0, 4.1, 4.0 s |
    | Node import() of vite from the volume | 2015, 1933, 1968 ms | 1926, 1926, 1938 ms (no real change) |

    The time is that of tabc run, boot included (about 1 s).

    Correctness, checked by hand on this build

  • The guest writes, appends to and renames a file. stat and ls show each change at once: 5 bytes, then 10, then the new name.

  • The host appends to a file the guest stats every 0.2 s. The guest sees the new size within 1 s.
  • Not run

    nix flake check: there is no nix on this machine. I built with go build and a share laid out as nix/share.nix makes it, from the same pinned tarballs (sha256 checked).

    🤖 Generated with Claude Code

    Diff: 341 lines (+255 / -86) across 4 files Reviewer: fzakaria Review duration: 812m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 341 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.349
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.3% (MEDIUM) · Higher = larger blast radius
    42.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.3% · Safe to merge
    18.3%
    Repository