Skip to content

Add the Goose implementation as an optional app - #13

Open
kaitk wants to merge 2 commits into
basecamp:mainfrom
kaitk:add-goose
Open

kaitk wants to merge 2 commits into
basecamp:mainfrom
kaitk:add-goose

Conversation

@kaitk

@kaitk kaitk commented Nov 6, 2026

Copy link
Copy Markdown

This adds once-campfire-goose, a port of Campfire to Goose, as an optional goose app. Select it with --apps rust,goose and GOOSE_IMAGE (default once-campfire-goose:app; source checkout ../once-campfire-goose). It is not in the default app list.

Prebuilt images for amd64 and arm64 are on GHCR, so you don't have to build the Goose compiler: GOOSE_IMAGE=ghcr.io/kaitk/once-campfire-goose:sha-9f52b4d, with ../once-campfire-goose checked out at 9f52b4d, the revision measured below.

The change:

  • goose in the allowed apps;
  • its topology record: one process, CAMPFIRE_HTTP_THREADS loops (default 4), the CAMPFIRE_HTTP_BACKEND (default epoll), whether CAMPFIRE_CACHE leaves the response cache on, native cable, and in-process delivery and media threads for jobs. Like c and cpp, it records no response_cache_mb;
  • the README.

ruby bin/check passes on this branch itself, without #11, and so does the preflight for --apps rails,rust,goose with Rust's main image and a Rails image built from once-campfire main.

Why Goose

Goose is a young systems language. Its compiler and packages are public, and the app's Dockerfile builds them from source at pinned revisions, so anyone can rebuild the image. The port follows Campfire's Rails code at once-campfire main (a05ee90, November 2), which includes everything in the 0aa339d this harness measures and the fixes its browser smoke checks. It uses Rails' SQLite schema and migrates the harness's 90b3300 seed as db:prepare does, and it uses Rails' storage layout, signed and encrypted cookies, signed IDs and Active Storage keys, and Rails' public pages. Uploads use libvips and ffmpeg, as Rails does, and the image terminates TLS with ACME certificates itself, as Thruster does.

Each area is compared against a Rails image built from a05ee90, response by response and as parsed HTML: sign-in and setup, rooms and Pings, messages and bots, search and paging, profiles and account settings, uploads, TLS, and what Rails' middleware answers (ETags and conditional GETs, default headers, Content-Security-Policy and Vary, exception pages, static files, Active Storage's proxies and direct uploads). Every compared response matches but three: a page rendered for a Turbo frame leaves out the csrf-param and csrf-token meta tags that turbo-rails' frame layout still writes, which nothing reads now that forgery protection checks Sec-Fetch-Site and Origin. That and the other deliberate differences are listed in the port's parity notes. Jobs run on in-process threads; on SIGTERM the server finishes requests in flight and its queued jobs for up to 8 seconds, as the Rust and Jai ports drain theirs.

Run on our host

An AMD Ryzen 7 5800X3D (8 cores, 16 threads) under WSL2 on Windows 11 Pro, not bare-metal Linux: Ubuntu 26.04.1, 15.6 GiB visible to WSL, Docker Engine 29.1.3 inside WSL. The apps ran on CPUs 8-11 and the load generator on CPUs 12-15; 3 rotated rounds, 16 clients, 8 seconds per route. Rails built from once-campfire main (a05ee90); Rust's newest published image (main, 6dae2fd); Jai from #11's published image (ghcr.io/lucasmeijer/once-campfire-jai:2ecd487), with #11 merged into this branch locally for this run only. The preflight passed for --apps rails,rust,jai,goose. Requests/sec, median of 3 rounds:

Route Rails Rust Jai Goose Goose/Rust Goose/Jai
Room page 2,245 19,066 162,054 167,417 8.78× 1.03×
Messages page 2,114 18,087 171,954 169,891 9.39× 0.99×
Sidebar 2,279 20,805 175,792 166,607 8.01× 0.95×
Search 2,257 20,878 169,112 173,233 8.30× 1.02×
Post a message 280 2,674 3,703 4,664 1.74× 1.26×

No errors, invalid or non-200 responses for any app, and every round's write audit verified for all four (22.6 million Goose requests). With --mixed-write-rate 10, the room page: Rails 737, Rust 17,426, Jai 154,989, Goose 161,445, again with no invalid responses and every audit verified.

The load generator, on 4 CPUs, used 385% of 400% during Goose's and Jai's page routes, so Goose/Jai there is the client's ceiling and Goose/Rust and Goose/Rails are lower bounds. Posting is bound by the servers (44% of the generator's CPU for Goose, 55% for Jai).

With the load generator on 12 CPUs, where it used under half of them, Goose read 1.02–1.08× as fast as Jai.

Memory, from a separate 2-round run sampling each container's cgroup once a second, page cache warm. Anonymous memory (page-cache pages are charged to whichever container read them first, so file memory doesn't compare); Rails' container holds Puma, Redis and Resque:

Rails Rust Jai Goose
Idle after start 305 MiB 13.7 MiB 4.4 MiB 8.6 MiB*
Under the page routes 648 MiB 20.7 MiB 18.6 MiB 14.8 MiB
While posting 889 MiB 90.0 MiB 77.4 MiB 16.1 MiB

* Goose sets up each of its four HTTP workers' compression state and buffers when it starts, rather than on first use, and starts all 26 of its threads; that is most of the difference from Jai at idle. It could be made lazy, but it doesn't grow under load, so we've left it for now.

Per process in the main run, peak resident memory (VmHWM) was 34.5 MiB for Goose, 98.1 for Jai and 113.8 for Rust, whose peaks come while posting.

As the Jai PR says, the page routes reward a cache of finished pages, and every implementation here, Rails' own included, now has one. The post row is the one that reflects production.

The harness's browser smoke test (browser/smoke.mjs at ec02deb, unmodified, in Playwright's Chromium) passes against the same image.

Three notes from running it

  • Rust's latest image tag points to an older build (24c8597, September 29), which fails this harness's preflight on search order; main (6dae2fd) passes. We measured main.
  • The seed's Rails revision, 90b3300, predates Read the newest search matches off the index instead of sorting them all once-campfire#304, so a Rails image built from it fails the preflight's search check (search: differs from seed SQL): it orders results by created_at, where the contract, Rails since that PR, Rust and Jai order them by id.
  • On a host where the harness runs as root, each run's copy of the seed belongs to root with mode 0644 while the images run as uid 1000, and the chmod through docker exec comes only once the app is up; Rails' migration then fails the preflight with "attempt to write a readonly database". Make each run's copy of the seed writable before the app starts #12 addresses it. We ran with fixtures/default made writable by everyone and umask 000.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings November 6, 2026 06:51

Copilot AI 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.

🟢 Approved

No active review issues are reported for the optional Goose integration.

No open issues 🎉

What changed in this PR

Adds Goose as an optional implementation in the shared Campfire verification and benchmark harness without changing the default app list.

Changes:

  • Accepts goose in --apps and records its HTTP, cache, cable and job topology.
  • Omits response_cache_mb for Goose, matching C and C++.
  • Documents GOOSE_IMAGE and explicit Goose selection.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
README.md Documents Goose support, image override and optional selection.
bench/​compare.rb Allows Goose and records its implementation-specific topology.

Review effort: Balanced

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