CT54.A6.CombinedSwarms — Audit: how to run it, and the science behind it

Built 2026-10-13 under Claude harness v4. This is the top-level guide to the program. The full science of this version, with every source, is in CT54.A6.CombinedSwarms_SCIENCE.md (.html). The build history, for resuming work, is in CT54.A6.CombinedSwarms.md.

What changed in CT54.A6

  1. The movie plays at the right speed. The screen and the movie now share one clock. * Not recording: ×1 is real time on screen, however many frames a second your computer draws. * Recording: every frame drawn is exactly one movie frame, 1/30 s of the simulation, and is then encoded. Nothing is skipped and nothing depends on how long a frame took to draw. * Result: the movie is a steady 30 frames a second and plays at the speed the screen shows when it is not recording. While it records, the screen itself may run slower than real time; that does not reach the movie. The HUD (press D) shows how fast the screen is running. * Why A5 was wrong. A5 stamped each frame with the time it had been on screen. Recording slows the screen down, so the movie copied that slow-down. It also made a file with an irregular frame rate, which some players mistime. A5's Timing selector is gone.
  2. The movie is as sharp as the screen. * The picture is now drawn at your screen's own resolution: the size, in real screen pixels, of the picture as it is shown in the window (the Windows display scaling is included). The movie is that picture, pixel for pixel. Before, it was always 1920×1080 and was stretched to fit larger screens, both on screen and when the movie played. * Movie size now reads Screen — W×H (default). Fixed sizes (1280×720 up to 3840×2160) are still offered; a smaller one draws faster. * If you resize or maximise the window before recording starts, the picture follows. Once a take has begun its size is fixed (a note says so). * Encoding at constant quality. The browser's software H.264 encoder is tried first, at constant quality (q 18; lower is sharper, ?q=). Some hardware encoders ignore the bit rate they are given and smear the tiny bees. Every encoder is tried on a real test frame before it is used, so one that claims support and then fails cannot spoil a take. The encoder used and the bit rate actually reached are shown in the HUD; ?encoder=hw prefers the hardware encoder.
  3. A new science document, CT54.A6.CombinedSwarms_SCIENCE.md, describes this version only, with no history of earlier versions.
  4. Option 5 is described as an experiment based on the author's observations, in the option card, the banner, the Option selector, the status text and both documents. It is still marked not documented in the literature and is still not the default.

The simulation itself is unchanged (labels only). The state hashes in §5.2 are the same as in CT54.A1–A5.

⏳ This simulation takes minutes to resolve. For the first minute the bees only mill in a loose cloud. The cluster forms over the next one to two minutes and is complete after about 2–3 minutes of simulated time (option 2: 76 % settled at 90 s, 99.9 % at 120 s). + speeds it up.


1. What this is

A browser simulation of a honeybee reproductive swarm: the old queen and several thousand workers have left the hive. They mill in a cloud, find the queen by her scent and gather around her. There is one index.html and five options:

# Option What you see Status in the scientific literature
1 Beard Mild, calm air. The swarm hangs from a thin vine stem under an old arbor as a long, pointed cluster. Documented
2 Compact (★ default) Cool air. The bees pack tight: a shorter, rounder, tightly bound cluster. Documented
3 Broad Hot air. The cluster loosens: short, broad and larger. Documented
4 Swaying Wind. The cluster hangs short and broad and sways in the gusts. Documented
5 Hovering ball (experiment) Still air. The queen hovers in the open, attached to nothing, and the bees keep flying in a dense ball, about 15 in across, around her. Experiment based on the author's observations — NOT documented in the literature

A banner above the picture always says which option is running, for example "2 · OPTION 2 OF 5 · COMPACT ★ DEFAULT · DOCUMENTED" or "5 · OPTION 5 OF 5 · HOVERING BALL (EXPERIMENT) · EXPERIMENT — BASED ON THE AUTHOR'S OBSERVATION, NOT DOCUMENTED IN THE LITERATURE".


2. How to run it

2.1 Start

  1. Unzip CT54.A6.CombinedSwarms.zip. Everything is in the folder CT54.A6.CombinedSwarms.
  2. Double-click index.html. It opens in your browser straight from disk. Use Chrome or Edge to make movies. No internet is needed: three.js r186, the movie packer and the fonts are bundled.
  3. The title art shows for 15 s (Space or two clicks skip it).
  4. The option card opens: "Choose one of five swarms". It says that the simulation takes minutes to resolve, lists the five options with their badges (green documented; rose experiment · author's observation for option 5) and marks option 2 ★ DEFAULT. Press Start, Space or Enter to run option 2, or click another option.
  5. The first click anywhere turns the sound on (browsers hold sound until then).
  6. The read-out displays start hidden. D shows them (the status plate upper left, the camera help lower left).

2.2 Changing option later

The Option selector, the keys 1–5, the banner, or ? Options (bottom left). Each reloads the page and starts the chosen option from the beginning. A fresh start (opening index.html) always runs option 2.

2.3 Controls

Control Key
Time Reset · Back · Pause · Forward · Slower · Faster R · B/← · Space · F/→ · − · +
Camera Drag: orbit · wheel or [ ]: in/out · right-drag or Shift-drag: pan · double-click: re-centre
Camera auto / orbit · orbit spin · aim (queen / centre / tip) A · O · T
Close-up window (lower right) P
Options 1–4 Hangs from: thin vine stem / flat beam (reloads)
Chains inside the shell · grip links · load shading N · G · K
Option 5 Move queen: she flies slowly 10 ft to the measuring pole (press again to send her back); works once she hovers, after ~30 s G
Follow: sight / scent — how the ball's bees keep with her (reloads) L
Look Shaded / wire · shadows · reflections · outlines · crystal wings W · Q · X · U · V
Displays Show / hide the read-out displays (off at the start) D (or H)
Other Scent slice · castes · visible size · auto-zoom · sound S · C · E · Z · M

2.4 Making a movie (no batch file, nothing to install)

  1. Open index.html in Chrome or Edge. Leave Movie size on Screen for a movie at your screen's resolution. Maximise the window first if you want it as large as possible.
  2. After a few seconds the note at the bottom says "● Recording is on" and names the size, the encoder and the sound. Recording runs from then on; the button shows ● Recording m:ss in movie time. Click it to pause recording (the simulation keeps running); click again to resume. A paused simulation is not filmed.
  3. Press ■ Finish & Make Movie. The MP4 (picture and sound) is downloaded to your browser's Downloads folder as CT54.A6.CombinedSwarms_movie_option<N>_seed<S>_<date-time>.mp4, then plays in the page. Start a new take reloads.

What to expect. * The movie runs at 30 frames a second at the speed shown on screen when not recording: at ×1, one second of movie is one second of the simulation. * While recording, the screen may run slower than real time (it is drawing and encoding every frame). That is expected and does not affect the movie. A 3-minute take may take longer than 3 minutes to record on a slow computer. * At constant quality the file size depends on the picture: roughly 200–800 MB per minute at a large screen size.

2.5 URL settings (for testing)

?option=1…5&intro=0 (or beard, compact, broad, windy, hover) · bees=N · seed=N · w=/h= (a fixed picture and movie size; default = the screen's) · q= (movie quality, 0–51, default 18, lower is sharper) · encoder=hw (prefer the hardware encoder) · mbps=N (bit rate when constant quality is not available) · moviegain= (movie sound level, 1 = normal) · panels=1 (displays on) · run=0 (open paused) · support=branch|beam (1–4) · follow=sight|scent and movespeed=ft/s (5) · shell=0 (1–4: the older hanging model without the shell).


3. What you should see

Seed 3906, default bee counts, measured in Node (the browser gives the same numbers).

Every option starts the same way. For the first ~12–20 s the bees mill in a cloud about 30–40 ft across over the summit; the queen flies among them, calmer than the workers. Then she leaves the cloud.

Option Where the queen goes 60 s 90 s 120 s 150 s: final shape
1 Beard under the vine stem (12 s) 29 % settled 99.6 % 99.9 % 9.6 × 4.3 in (long × wide): a long, pointed beard
2 Compact under the stem 16 % 76 % 99.9 % 6.8 × 4.4 in: shorter and rounder
3 Broad under the stem 30 % 95 % 100 % 7.2 × 5.9 in: broad, the largest volume
4 Swaying under the stem 19 % 65 % 95 % 4.9 × 5.3 in: wider than long, sways ~0.7 in
5 Hovering ball a point in the open, 7 ft up, 4 ft in front of the arbor (20–28 s) 18 % in the ball 61 % 96.5 % ball ≈ 15 in across

4. The science behind it (summary of the SCIENCE document)

4.1 The swarm and the scent (all options)

4.2 Options 1–4: the hanging cluster (documented)

4.3 Option 5: the hovering ball — an experiment based on the author's observations


5. Audit of the build

5.1 How it is put together

5.2 Verified in this build

The simulation is unchanged, to the bit. With seed 3906 the state hashes are the same as in CT54.A1–A5 and the programs it came from:

Check (seed 3906) CT54.A6 Earlier
Option 1, 2,000 bees, 30 s 4fe60707 4fe60707 (CT39.C8, CT54.A1–A5)
Option 5, 2,000 bees, 40 s fbbc0818 fbbc0818 (CT52.A2, CT54.A1–A5)

The movie (headless Chromium, software graphics, opened from disk): * Timing: while recording, the simulation advanced exactly 4 steps (1/30 s) per movie frame: 10 frames = 40 steps = 0.333 s of simulation, and the MP4 lasts 0.333 s at a constant 30/1 frame rate, with sound of the same length. (That machine draws only a fraction of a frame per second, so the test is short; the timing does not depend on speed.) * Size: with no w/h, the picture and the movie came out at the screen size of the shown picture (device pixels; checked at 1.5× display scaling); Movie size read "Screen — W×H (default)". * Encoder: that browser has no H.264 encoder, so it fell through to VP9 at constant quality after the test frames; Chrome and Edge on Windows have software H.264. ffprobe: one video and one audio stream, constant frame rate. * No console errors.

Not tested here: the H.264 encoders of Chrome and Edge on Windows (not available in the test browser), and speed on a real graphics card.

5.3 Known limits


6. Files

File What it is
index.html The program. Open this.
CT54.A6.CombinedSwarms_sim.js The simulation (deterministic, no drawing)
CT54.A6.CombinedSwarms_main.js Drawing, camera, controls, sound, movie
CT54.A6.CombinedSwarms_lib/ three.js r186 and mp4-muxer 5.2.1 (local), with their licences
CT54.A6.CombinedSwarms_fonts/ Fonts (SIL Open Font Licence)
CT54.A6.CombinedSwarms_title.webp Title art
CT54.A6.CombinedSwarms_AUDIT.md / .html This guide
CT54.A6.CombinedSwarms_SCIENCE.md / .html The science of this version, with all sources
CT54.A6.CombinedSwarms.md / .md.html Context file: build history, for resuming work in a later chat

7. Main sources

(The full list is in SCIENCE §11.) * Seeley, T. D. (2010). Honeybee Democracy. Princeton University Press. * Beekman, M., Fathke, R. L. & Seeley, T. D. (2006). How does an informed minority of scouts guide a honeybee swarm as it flies to its new home? Animal Behaviour 71, 161–171. * Peleg, O., Peters, J. M., Salcedo, M. K. & Mahadevan, L. (2018). Collective mechanical adaptation of honeybee swarms. Nature Physics 14, 1193–1198. * Nguyen, D. M. T. … Peleg, O. (2021). Flow-mediated olfactory communication in honeybee swarms. PNAS 118. * Shishkov, O. et al. (2022). Strength-mass scaling law governs mass distribution inside honey bee swarms. Scientific Reports. * Heinrich, B. (1981). The mechanisms and energetics of honeybee swarm temperature regulation. J. Exp. Biol. 91.