Skip to content

feat(native): use compact paths in fresh runtime pools - #1134

Draft
roodboi wants to merge 10 commits into
nextfrom
fix/native-compact-pool-layout
Draft

roodboi wants to merge 10 commits into
nextfrom
fix/native-compact-pool-layout

Conversation

@roodboi

@roodboi roodboi commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Behavior

A new development project pool uses the compact path layout for project shares, application bridges and dependency sockets. Its default of 16 application bridges and eight dependencies fits with eight project shares under the conservative 2,048-byte boot budget. Larger requested counts take precedence when they fit. A collision between two project share prefixes refuses the addition under the provider lease and identifies both projects.

Existing owners without a layout field retain the legacy paths through start, stop, recovery and journal replay. The authored container destination and the dependency socket target inside the container stay stable. Bind sources come from the selected pool layout. The relay uses the selected socket without a cross-layout fallback. Older executors refuse the unknown field rather than operating on a compact home.

What this carries from #1122

  • 5874cdcd5 supplies the fresh-pool default selection and exact/minimum semantics.
  • 059a52f7e supplies the configurable split. The 24+8 historical target is superseded by 16+8 in the compact layout.
  • f19c5bb7c supplies the pre-boot budget and refusal for fresh/stopped starts and stopped share/network updates. This branch charges the selected layout and retains the legacy byte calculation.
  • 18122d5aa preserves validation order before the boot budget so invalid slot requests keep their original diagnostics.

Evidence

The Linux Rust suite, focused frontend tests and Apple Silicon macOS cross-check passed. The old executor refused the compact fixture on status, up and recover, and the fixture snapshot stayed identical. The model verified four states. Its negative control permits an older runtime to rewrite the layout and violates the invariant. The SVG and Mermaid source are included. Live Mac qualification precedes independent review.

Layout state chart


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hack-docs Ready Ready Preview Nov 25, 2026 1:38am UTC

Request Review

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: 2be7dd9

  • Frozen install, root typecheck and lint passed. Rust 1.97.1 formatting and clippy passed. The full Linux Rust run passed 1,576 library tests and 48 main tests, plus the integration and doc-test targets. Three additional focused layout tests and 83 focused frontend tests passed.
  • The Apple Silicon all-features, all-targets cross-check passed. The actual older executor refused status, up and recover on a compact owner fixture with the state snapshot unchanged. Privacy passed after staging, gitleaks found no leaks, and the remote head matches.
  • The checked layout model verified four states. Its negative control caught an older executor rewriting the compact owner. SVG and Mermaid source are included. Browser PNG and live Mac qualification are pending.
  • At eight shares and eight dependencies the compact byte model admits 19 bridges at 2,042 B. The twentieth bridge puts the projected eighth-share addition at 2,065 B, so it should refuse without changing the seven-share pool. The 16+8 and 17+8 rows model at 1,973 B and 1,996 B.
  • Kept the 980-byte fixed reserve. Existing pools retain their owner layout and the dependency relay has one stable in-container socket target. The 7.4 GiB build target and temporary older-executor checkout were removed.
  • Draft for the Mac rows. Independent review follows the VM run.

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Lead read of 2be7dd9: the source change over #1122, in full. One layout value chosen at creation, absent means the old names, every reader takes it from the owner record, and the container-side target of a dependency socket stays as it was. That is the shape I wanted.

Next on a Mac: the slot table at 16 + 8, 17 + 8, 19 + 8 and 20 + 8 with one and eight shares, then the standard scenarios that touch sockets and shares, with an older home among them. The two-project rows wait for #1119 to merge, because this head conflicts with it in graph/bridges.rs and share_update/tests.rs (and two generated lists). An independent review follows the Mac rows.

🤖 Generated with Claude Code

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: c3e7f3e

The compact guest listener parent was missing. The provider mapping and all relay actions already select the layout's path. Guest startup now creates the compact directory on demand and checks its owner, mode and slot before staging a relay. The legacy path and relay fences keep their existing locations.

  • Frozen Bun install passed. Typecheck and lint each reported 2 successful tasks.
  • check:local and test:local passed with Rust 1.97.1. Library: 1,580 passed, 0 failed, 46 ignored. Crate integration suites passed.
  • Linux script regression: 1 passed, 0 failed. The same fixture reproduced ENOENT with the previous script, then bound a real Unix socket with the new launch checks. The test includes occupied, mismatched, permissive and aliased path refusals.
  • Shell syntax, staged privacy and gitleaks passed. Remote branch SHA verified.

The new head needs the real Mac project scenario rerun. The earlier Mac results verify compact pool boot, share admission and the byte-budget edge. Linux does not exercise the guest netns or provider mapping. Independent review follows the Mac rows.

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: 5a332ba

  • Compact bridge listeners now live on a private bounded tmpfs mounted at guest setup. Startup and retired absence check the exact slot path. Compact startup and retirement require the boot-local mount. Legacy paths and relay metadata keep their existing directories.
  • Fresh primary shares convert once. Collision rejection remains under the lease in the existing share set validator. The new Mac test exercises a compact add and resumes a second add after committing its provider row.
  • For an older executor, runtime down decodes owner.json in read-only status before taking a mutation lease. Runtime recover's preliminary alias helper also decodes it before any write or lease. The compact field causes the old decoder to refuse.
  • Frozen Bun install, root typecheck and lint passed. Focused Bun: 59 passed, 0 failed.
  • Rust 1.97.1 check:local and test:local passed. Library: 1,579 passed, 0 failed, 46 ignored. Integration suites passed. The Apple Silicon all-features test target cross-checked.
  • Full test:models passed. Layout model: 38 distinct states. The negative control witnessed an older writer violating LayoutPreserved. The updated chart is SVG. Browser PNG rendering remains on the Mac.
  • Shell syntax, staged privacy and gitleaks passed. Exact remote SHA verified.

Mac pending: unclean provider stop with a live relay and reuse of that slot after reboot, plus the compact interrupted-add test. The previous Mac head passed webdb, up-twice, kill-publisher, logs-follow and exec-tty. Stop-up and built-two matched base failures.

@roodboi

roodboi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Lead triage: STILL NEEDED, on the stable path (concurrent native projects). Rebase after #1122, then run the Mac slot table and post a ready note.

Checked against next at c87c566.

Next step: once #1122 merges, rebase or merge next. Then run the Mac rows the lead asked for: 16+8, 17+8, 19+8 and 20+8 with one and eight shares, the socket and share scenarios with an older home, and now the two-project rows, since #1119 is in. Then get an independent review, post a ready note, and decide #1224 (close in favour of this, or keep only its range checks).

🤖 Generated with Claude Code

@roodboi

roodboi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: 8a211ad

Normal merge of #1122 at a0afb15, including next at c87c566. Publisher socket lookup uses the basename from the recorded layout. Idle share admission compares the requested share in the pool's layout before deciding whether a stop is needed.

Frozen install, root typecheck, staged lint and privacy passed. Focused Bun: 366 passed, 0 failed. Rust 1.97.1 fmt, Clippy and test:local passed. Library: 1,665 passed, 0 failed, 47 ignored, plus the integration suites. The long temporary checkout exceeded Unix socket path limits for unrelated node tests. A clean rebuild in a shorter checkout and the final two-thread suite passed. Apple Silicon all-features test cross-check, shell syntax and gitleaks passed. TLC checked 38 layout states and the older-writer control produced the expected LayoutPreserved violation. Remote SHA verified.

M5 rows on the merged head:

Bridges + dependencies One share Eight shares
16 + 8 Boot, also try the default Boot
17 + 8 Boot Boot
19 + 8 Boot Boot
20 + 8 Boot Refuse the eighth share before boot, leaving seven shares

Pre-admit both roots to a stopped default pool. Start A with nine bridge slots still free. Start B alongside it with six routes and three loopback ports. Verify all nine B endpoints, confirm the two runs share one VM, and probe A during B's start and down.

Boot an existing legacy pool from #1122 with its recorded counts, for example 8 bridges + 1 dependency. A missing socket_layout decodes as legacy. Counts and paths stay as recorded and the field remains omitted. Fresh pools write compact-v1. An older executor refuses that field before mutating the owner.

The table, concurrent run and existing-home rows await the merged-head Mac run.

@roodboi

roodboi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Mac VM rows at 8a211ad: all pass.

Real VM on an Apple Silicon Mac, with a signed bundle built from 8a211ad2fb. Each row used a fresh, isolated native home, runtime up --profile development --internet with the first share, and then runtime project-share add for shares 2–8 on the stopped pool. The byte counts come from this PR's compact formula (980 + 53 per share + 25 + 23 per bridge + 22 per dependency). The share counts come from the owner record and from the booted VM's mount list.

Slot table

Bridges + dependencies One share Eight shares
default pass: 16 + 8, socket_layout: compact-v1, 1,602 B, boots pass: 8 shares, 8 project mounts, 1,973 B, running
16 + 8 pass: 1,602 B pass: 1,973 B
17 + 8 pass: 1,625 B pass: 1,996 B
19 + 8 pass: 1,671 B pass: 2,042 B
20 + 8 pass: 1,694 B pass: the eighth project-share add is refused with pool_boot_command_line_budget (2,065 B), exit 2, in 0.61 s, and leaves 7 shares; the pool then boots with 7 project mounts (2,012 B)

Every runtime up and every accepted project-share add exited 0.

Two projects

  • Setup: a stopped default pool (16 + 8, compact-v1) with both roots admitted. A has 4 routes + 3 loopback ports (7 bridges), which leaves 9 free.
  • A: hack up -d exit 0 in 8.6 s; all 7 of A's endpoints answer.
  • B: 6 routes + 3 loopback ports. hack up -d exit 0 in 4.5 s, and all 9 of B's endpoints answer 200.
  • One VM: the same VM process held the pool's disk before and after B started.
  • B stops: hack down of B exit 0 (22.0 s), and A's 7 endpoints still answer.
  • Polling: A's endpoints answered 200 in all 322 samples (every 0.5 s through B's start and stop).

Existing pools

Not run: the unclean provider stop with a live relay and that slot's reuse after reboot, and the compact interrupted-add test. Both are listed as Mac pending in an earlier note.

The first pass of the default and 16 + 8 rows reported red because of my harness, not the product: it counted mounts under the legacy /mnt/hack-projects/ prefix, and this layout mounts at /mnt/hp/. I fixed the check and reran both rows. The results above are from the reruns.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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