Skip to content

chore: open-source tooling, CI and faster WebGL start-up - #1

Merged
entity merged 13 commits into
mainfrom
chore/open-source-tooling
Oct 12, 2026
Merged

entity merged 13 commits into
mainfrom
chore/open-source-tooling

Conversation

@entity

@entity entity commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Tooling for the open-source release, plus a WebGL start-up speed-up.

Tooling

  • Licence: MIT for the figure (LICENSE); kit/ keeps its own MIT licence.
  • package.json: npm run build, check, typecheck, site, serve, deploy. TypeScript and Wrangler are the only dev dependencies; the figure still builds with Node alone.
  • Type check: tsc as a checker over plain JavaScript. Files opt in with // @ts-check; model.mjs and world.mjs are the first, with a State typedef for the flight model.
  • CI (ci.yml): type check, figure checks and the flight-model test on every push and PR.
  • Releases (release.yml): a v* tag builds both single-file pages and attaches them to the release. The built pages are no longer tracked (each rebuild added about 4 MB to history).
  • Deploy (deploy.yml, wrangler.jsonc): deploys air.pla.ne on pushes to main. It is skipped until the repository secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID are set. The link-preview images are captured on SwiftShader (no GPU on the runner); tested locally, about 2.5 min.
  • Docs: CONTRIBUTING.md; code comments no longer point at the unpublished a380/notes/ files.

WebGL start-up

Window pieces, wash targets and nacelles are drawn from uniform tables instead of being baked into the GLSL, and every program has one source for both themes.

Before After
Programs compiled 25 10
GLSL in the dark payload 677 KB 184 KB
Programs that differ between themes 5 0
First light, desktop 6.5 s 5.0 s
First light, phone (4× CPU, 4G) 9.9 s 6.8 s
Theme switch, programs linked 1.6 s 0.75 s

Parity: 15 states per theme, captured before and after. 28 of 30 match exactly; two differ in one 2×2 spot at a window or door edge. The canvas painter and the no-WebGL fallback pass, and the take-off blinds and beacon still render correctly.

Notes

  • What's left of first light is mostly the 3.7 s fade from the fallback lights to GL. Shortening it is a design choice, left for later.
  • Uniform budget: the windows program now uses 167 fragment uniform vectors, up from 99. A device with a lower limit gets the fallback lights instead of GL.
  • Not split: kit/turn.mjs and kit/turn-fixed.mjs come from the upstream Anatomy kit; splitting them would make kit updates harder to take in.

entity added 13 commits October 12, 2026 14:20
The kit in kit/ already carried its own MIT licence; the rest of the
repository had none, so the public code could not be reused.
npm run build, check, typecheck, site, serve and deploy wrap the existing
node commands. TypeScript and Wrangler are the only dev dependencies; the
figure still builds with Node alone. wrangler.jsonc deploys a380/dist to
air.pla.ne as Workers static assets.
tsconfig.json runs TypeScript as a checker over plain JavaScript: files opt
in with // @ts-check. model.mjs and world.mjs are the first; a State typedef
and JSDoc on step() and poseOf() give the rest of the code something to
check against.
Each rebuild of a380.html and a380-light.html added about 4 MB to the
history. They are build output: npm run build writes them, and a version
tag now builds them and attaches them to its GitHub release.
The workflow runs npm run deploy with the link-preview capture on
SwiftShader, and skips itself until the CLOUDFLARE_API_TOKEN and
CLOUDFLARE_ACCOUNT_ID secrets exist.
… in one program each

The windows (19 pieces in 11 programs, 18-34 KB each) and the washes (35 targets
in 6 programs) baked each piece's hull planes, window stations, blinds, doorways
and colours into its own GLSL function. Each piece or target is now a pass whose
tables (windowPartData, washTargetData) are set as uniforms, so each family is one
program (windows 13 KB, washes 8 KB) and the washes source no longer differs
between the themes (the logo's daylight cap is a uniform). 25 programs become 10.

Parity (reduced motion, paused, 15 states per theme): 0 px over 8 levels except
two 2x2 spots (max 21) on window/door edges; uniform need 99 -> 167 vectors.
The engines program held four copies of the inlet, fan and spinner, each with its
nacelle's position as literals (27 KB, the slowest program left at about 200 ms).
One function now takes uEng (y, z, lip plane) and uRun/uGain on each nacelle's pass
(11 KB). Parity: unchanged from the previous commit in both themes.
…d programs

These three families still generated different GLSL per theme (the dark glow or the
daylight paper rule, and the night-only beacon, strobe and beam terms). Each now
carries both rules, chosen by uLight, which is fixed per page. Every one of the 10
programs is now byte-identical in the dark and light builds, so after a theme
switch the browser's shader cache links them again at once.

Parity: unchanged from the previous commits in both themes; build --check passes
for both themes.
…kpit program

The registration-driven cockpit program (one pane or display a pass, from M2's and
M7's targets) also carried the baked canopy hull, pane outlines and lifted displays
of the build-constant passes, which only cockpit.all calls (27 of its 42 KB). It now
carries only what it calls (13 KB); cockpit.all, compiled only in a build without
those targets, is unchanged.

Parity: unchanged from the previous commits in both themes.
README: the before/after of the uniform-table programs (programs, GLSL bytes,
first light, the switch, parity) and the lights note (the fade now dominates first
light; the windows program's uniform-vector count). harness.js: the chunk comments
name cockpit, the one family still split.
Code comments named files under a380/notes/ that are not in the public
repository. They keep their labels (kit patch 15, f3-engine E5) without
the dead path, and DESIGN.md and a380/README.md say where their remaining
notes/ references lead.
@entity
entity merged commit 2d85c04 into main Oct 12, 2026
1 check passed
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