CT54.A6.CombinedSwarms — context file

Read this first to resume. CT54.A6 = CT54.A5 with the movie timing and sharpness fixed, a new science document for this version only, and option 5 described as an experiment based on the author's observations. The simulation and every hash are CT54.A1's. Then read CT54.A6.CombinedSwarms_AUDIT.md (how to run it) and CT54.A6.CombinedSwarms_SCIENCE.md (the science of A6 only, no history).

The user's request (CT54.A6)

The video continues to be at the wrong speed and the images appear to be soft. I need a document created which is the science of the current version, not the previous versions. The hovering swarm should be described as an experiment based on the observations of the author

Diagnosis

What CT54.A6 changed (_main.js, index.html)

Verified (CT54.A6)

Next ideas (not requested)


CT54.A5 context (still valid except where A6 changed it above)

The user's request (CT54.A5)

First, I would rather not run a batch file to get a movie. Second, getting the movie seems to fail. Third the movie that is produced does not have audio. Fourth the movie that is produced is too low resolution. Can any of this be fixed?

(Context: A4's index.html showed nothing for the user; the user's movies so far came from A3's PNG frames, which I encoded with ffmpeg here: 1280×720, no sound.)

What CT54.A5 changed (_main.js)

CT54.A5 fix (same day): "The video still seems to be at a different (much faster than live) speed. The imagery is softer than what I see on the screen"


CT54.A4 context (still valid except where A5 changed it above)

The user's request (CT54.A4)

The audit says that ffmpeg could not be found, to reextract the zip, I did but it still did not work. I need a way to make a movie of this.

Diagnosis

On disk, A3's folder held the bundled ffmpeg.exe, and the user had also extracted the zip into it (nested CT54.A3.CombinedSwarms/CT54.A3.CombinedSwarms/). New frames (18:47) were written by a server rooted in the outer folder, and the page showed the "not found" note. Most likely the server process was the pre-fix A3 server (started before bundled_ffmpeg() existed) still holding port 8739; the new launcher could not bind and exited. Not confirmed, but A4 removes the dependency anyway. I made movies from both of the user's A3 takes with the bundled Linux ffmpeg: CT54.A3.CombinedSwarms_movies/…182003.mp4 (19 s) and …185022.mp4 (4 s).

What CT54.A4 changed


CT54.A3 context (still valid except where A4 changed it above)

The user's request (CT54.A3)

Please mark the compact swarm option 2 as the default in a way that is obvious to anyone running this. Right now it comes up with the anomalous hover swarm as the default. Please start with the displays OFF, but a little notice for how to turn them on, maybe a little discreet text that says "Hit D to show displays" or something.

What CT54.A3 changed

CT54.A3 fixes (same day, after the user's report "movie failed, ffmpeg not found for windows" and "the type needs to be reduced so that the options menu fits without a scroll bar")


CT54.A2 context (still valid except where A3 changed it above)

The user's request (CT54.A2)

This is the same as CT54.A1.CombinedSwarm Except that it should make clear that item 5 is an anomaly and it should default to one of the more common swarms, a tightly bound one. Also there should be a keystroke to make the displays that take up so much space in the upper left and lower left go away (perhaps 'D') It should also make clear in the herald that the simulation takes minutes to resolve.

What CT54.A2 changed


CT54.A1 context (still valid except where A2 changed it above)

(File names below were renamed A1 → A2 in this folder.)

The user's request (CT54.A1)

Combine CT39 and CT52 into one combined swarm structure. Make it clear which of the 5 options one is picking. There should be one index.html file Make it clear that option #5 was observed (hovering in air) but not documented in the literature. At the top level have an audit .md and .html file to describe how to run this application and what the science is behind it.

The five options

# key sim settings from status
1 beard weather mild (22 °C), stem CT39.C8 documented
2 compact weather cool (11 °C), stem CT39.C8 documented
3 broad weather hot (32 °C), stem CT39.C8 documented
4 windy ("Swaying") weather windy (18 °C, gusts), stem CT39.C8 documented
5 hover ("Hovering ball") hover: true, 20 °C, still air, queenSettle 20 s, support irrelevant CT52.A2 observed, NOT documented

The 5 options are the four CT39.C7/C8 Weather presets plus the CT52 ball. "Hangs from" (stem / flat beam) is kept as a secondary setting for 1–4 and shows "nothing — the queen hovers" (disabled) for 5.

What CT54.A1 changed

Simulation (CT54.A5.CombinedSwarms_sim.js)

Page and renderer (index.html, CT54.A5.CombinedSwarms_main.js)

Results (seed 3906, default counts; Node = Chromium)

option 60 s 90 s 120 s 150 s hash at 150 s
1 29.4 % settled 99.6 % 99.9 % 9.6 × 4.3 in f96fb561
2 15.5 % 76.4 % 99.9 % 6.8 × 4.4 in b525ef4c
3 29.6 % 94.5 % 100 % 7.2 × 5.9 in 84fc612a
4 18.5 % 64.7 % 94.9 % 4.9 × 5.3 in 6c48c567
5 17.6 % in ball 61.4 % 96.5 % ball ≈ 15 in (rms-equiv. 14.3 in) 96e1ecbd

(1–4: length × width of the settled bees from clusterShape().)

Verified

Next ideas (not requested)


Context inherited from CT39.C8.Swarm (options 1–4)

(File names below are the CT39.C8 names; in CT54 the prefix is CT54.A1.CombinedSwarms and the About file is the Audit.)

CT39.C8.Swarm — context file


CT39.C7.Swarm context (still valid)

Browser simulation (WebGL + three.js r186, vendored; works from disk) of a honeybee reproductive swarm. The bees mill around, then cluster under an old, broken wooden arbor at the brink of a summit high above the Adriatic, just before dawn. Open index.html (or run CT39.C8.Swarm_start.bat / .sh to record movies).

The user's C7 request

Real clusters don't show loose, dangling strands of bees on the outside. The chains are hidden under a smooth, tightly packed outer layer. Cover the cluster with a dense outer shell of bees, with the chains inside it. Add a Weather or Support setting that changes the shape: warm and calm on a thin branch gives the beard, while cold, wind, or a flat surface gives a compact ball. Also remove the text from the start of the simulation, just put a reference to an MD or whatever file that describes the situation.

(Background: the user's friend Craig Reynolds disputed the beard shape; a report that morning found that both shapes occur, depending on conditions.)

What C7 changed

Sim (_sim.js)

Page (index.html, _main.js)

C7 results (Node, seed 3906, 7,500 bees, 150 s; depth × width of the settled bees, 1–99 %)

weather / support depth × width (in) shape
mild / branch 7.8 × 3.8 beard
cool / branch 5.3 × 3.9 compact
hot / branch 5.6 × 5.1 broad (volume ~2×)
windy / branch ~4.2 × 4.5 broad, sways ~0.7 in
mild / beam 5.6 × 4.7 compact mound
windy / beam 4.1 × 4.9 short, broad

Known limits (C7)


CT39.C6.Swarm context (still valid except where C7 changed it above)

The user's C6 request

The following title cards will replace the one you wrote, with these 4, they will just be type overlays on top of the 3D environment but before any bees are present. Each card, so-called, fades in and then out. After the final card, the queen and the bees appear in the space and the audio begins. 1. "The following is a simulation of what is apparently considered a typical bee reproductive swarm." 2. "In this case, when the hive gets overcrowded, the old queen and some number of drones and workers are ejected from the hive, and the original hive grows new queens." 3. "In the mean time, the old queen and some loyal workers, attach themselves to a branch or some other handy surface, while scouts go out to find a place for the new hive." 4. "So this is a simulation of the queen and workers, having been ejected, as they create a temporary home. The bees are literally hanging from each other in long chains of bees."

The captions are used word for word. Only one stray comma is dropped, in card 3 ("loyal workers, attach" → "loyal workers attach").

Pending from the conversation (not in C6): the user saw a real swarm, a ~10 ft sphere of bees contracting to a 12–18 in ball that seemed unattached and not gripping. They will describe it, and a "hovering ball" mode can be built from that later.

What C6 changed

The opening sequence (runIntro() in _main.js; #caption in the page)

  1. Title: the title art (swarm 3) for 15 s, as in C4.
  2. The empty scene: the art fades, and the dawn scene comes up out of black: the arbor, the cliff, the sea, the moon. No bees are drawn. * beesHidden hides the five bee meshes and the chain lines; the close-up window is not drawn. * The HUD and the camera help are faded out (body.intro). * The simulation stays paused at t = 0, so the scene is a still dawn.
  3. The four captions: * Look: each one, in turn, fades in (1.6 s), holds, and fades out (1.7 s). They are type only: Metamorphous in pale gold, with a dark glow behind the letters and a soft vignette for legibility, placed in the lower third over the scene. * Hold time: reading time, max(5, 2 + 0.33 × words) s, so about 7 s for card 1 and about 12 s for cards 2–4. The whole sequence is about 75 s. * Hint line: a small "Click to turn on the sound · Space to go on" sits under the text.
  4. The bees: after the last caption the bees appear, the HUD and the camera help fade back in, and the simulation starts. The sound of the bees rises as it starts (as before, the sound is silent while paused). * Browsers allow audio only after a click or key press. The first click wakes the sound without skipping; later clicks, or Space / Enter / Esc, step on through the sequence.

URL options: * ?intro=0 skips everything. * ?title=<s> sets the title's time. * ?captions=<x> scales the captions' hold times.

Removed: the C2 Zoltar-style card (#card) is gone from the page. Its CSS remains, unused.

Simulation: unchanged. The hash is the same as C5.

C6 verified (headless Chromium, SwiftShader, from file://)


CT39.C5.Swarm context (still valid except where C6 changed it above)

The user's C5 request

There should be some text with camera instructions, probably on the lower left of the main viewscreen window. It should probably advise the user to use the mouse to change the camera pov and the scroll wheel to move in or out. I think the wide viewscreen is pointing at the queen at the top of the cluster, but it would be nice if there was some more flexibility to change the camera pov to get a better idea of the structure of the swarm as it is being built. The close in viewscreen could be closer as long as it keeps the entire "settled, hanging" swarm in window.

What C5 changed (_main.js "C5:", CT39.C6.Swarm.html)

1. Camera help, lower-left of the picture (#camHelp)

A small translucent plate in gold monospace type: * Drag: orbit around the swarm. * Wheel: move in / out. * Right-drag or Shift-drag: pan the view. * T: aim at the queen · centre · tip. * Double-click: re-centre. * A: auto camera.

Placement and behaviour: * placeHelp() puts it in the corner of the rendered picture, not the window: the canvas is letterboxed, and the plate follows on resize. * It is not part of the WebGL canvas, so it never appears in recorded movies. * H hides it together with the HUD.

2. More freedom for the main camera

3. The close-up comes in as close as it can

Simulation: unchanged. The hash is the same as C4 (seed 3906, 7,500 bees, 200 s: 648fafb6).

C5 verified (headless Chromium, SwiftShader, from file://)

Known limits (C5)


CT39.C4.Swarm context (still valid except where C5 changed it above)

The user's C4 request

Please change the opening splash graphic to "swarm 3.webp" as found in the folder "C:\Users\micha\Downloads\claude\CT39.artwork"

The rest of the message repeated the earlier specs and lists, all already in place.

What C4 changed

C4 verified (headless Chromium, SwiftShader, from file://)


CT39.C3.Swarm context (still valid except where C4 changed it above)

The user's C3 request

The rendering should default at the start to "shadows off".

The rest of the message repeated the C1 spec and the B2, B3 and C2 lists, all already in place.

What C3 changed

C3 verified (headless Chromium, SwiftShader, from file://)


CT39.C2.Swarm context (still valid except where C3 changed it above)

The user's C2 request

There appears to be some sort of repeating pattern, visible artifact on the ocean seen at a distance that looks bad. I think we should rewrite the text explanation used at the beginning of the simulation, to explain what is going on in more concise, less arcane language. Among other things it should explain that we are using the scent model of bee organization, and that the bees are organized in chains with the top bee gripping the surface of whatever material it is hanging from.

The rest of the message repeated the C1 spec and the B2 and B3 lists. These were handled as in C1 (see below).

What C2 changed

1. The sea (_main.js, "C2: the waves")

The cause. Since B3 the sea's ripples were a 256-px canvas normal map tiled 900 times across the 200,000-ft plane, so the pattern repeated every ~220 ft. Far out, the tiles and their mip levels lined up into a visible regular grid and moiré.

The fix: the waves are computed per pixel from the world position (seaMat.onBeforeCompile). There is no texture any more. * Wave trains: 13 of them, with incommensurate wavelengths from 1.7 to 173 ft and directions spread around a wind direction, so the sum never repeats. The long ones are kept gentle (slope ≤ 0.013) so they never read as stripes; a first try with a stronger 309-ft swell drew parallel bands. * Irregular chop: the gradient of value noise at 5, 13 and 31 ft. * Patchiness: a slow noise (260 and 900 ft scales) varies the wave strength across the sea. * No aliasing: every wave train and noise octave fades out once it is finer than about a pixel. The fade is computed from the pixel's footprint on the water, fwidth(world xz). * Far sea: the detail that fades away is replaced by extra roughness (up to +0.33). The far sea goes smoothly to a soft mirror, and the glitter path widens the way real sub-pixel chop widens it. * Settings: base roughness 0.12, metalness 0.85, customProgramCacheKey 'sea-c2'.

2. The opening card (CT39.C6.Swarm.html, #card)

The card is rewritten in plain language, in the same CT46-style frame and fonts. * Heading: "The Exiled Queen and Her Swarm", with the kicker "The Swarm · What you are watching". * Three short paragraphs: 1. why a hive swarms: the old queen leaves with about half the workers and some drones, and they wait while scouts search for a new home; 2. the scent model: the queen, then each settled bee, gives off a scent that drifts through the air; every bee flies toward it and steers by its neighbours; 3. chains: a bee lands where it touches the cluster; the top bee of each chain grips the wood of the arbor and every bee below holds on to the bees above; a new bee starts a chain or joins one. * Styling: the drop cap is on the first paragraph only, and the key terms are in gold. * Footer: "Click to turn on the sound · Space to continue".

Simulation: unchanged. The hashes are the same as C1 (seed 3906, 7,500 bees, 200 s: 648fafb6, in Chromium and Node).

C2 verified (headless Chromium, SwiftShader, from file://)

Known limits (C2)


CT39.C1.Swarm context (still valid except where C2 changed it above)

The user's C1 request (abridged)

An ancient site, possibly the Adriatic, at altitude, just before dawn; the sky lightening, the moon visible. We are overlooking the ocean from a high place. There is an old wooden arbor here, in bad shape. That is what the queen attaches herself to. Natural lighting, diffusely lit, occasionally backlit. Metal bees with narrow black and broad gold stripes, crystal wings, five red eyes, outline rendered. UI toggles for shaded/wireframe, shadows and reflection mapping. Title 'swarm 9' for 15 s, then the arcane card. Scent, neighbours, land on contact. Two viewports. Gold status type. Bee audio.

The B2 and B3 lists were repeated with it.

How the repeated lists were read: * Kept from B3: the distant Adriatic, no outlines on the stone, a degraded surface, and only one or two stars. * Stars: B2 asked for Rigel, Betelgeuse, the Pleiades and three planets; B3, the later request, asked to remove all but one or two. B3 wins: Venus and Jupiter and the crescent moon. * Gone with the stone: the B2/B3 items that only applied to the arch and ruins (a thin arch without gaps, crepidoma, stones) no longer apply. * Unchanged: 7,500 bees, outline off by default (U turns it on), the close-up placed low and looking up, and the compact HUD.

What C1 changed

The arbor (_main.js, "C1: THE ARBOR"; _sim.js, arborBoxes())

  1. The arch, the crepidoma and every stone block are gone. In their place is an old wooden pergola: * Posts: four, 0.5 ft square. * Beams: two long ones along X, 0.55 ft wide × 0.75 ft deep, 10.4 ft long, one at the front (z = siteZ) and one 5.5 ft behind it. * Rafters: five across the beams, overhanging by 1.1 ft. Two are missing, and the gap is over the queen. * Slats: four thin ones across the rafters.

Its bad shape: * Sag. Both beams sag 0.18 ft at mid-span, a parabola that is lowest where the queen hangs. * The fallen rafter still hooks on the back beam and its other end lies in the grass behind. * A loose brace has come away and lies against the front-left post. * Splintered ends on the back beam, on the rafters and on one slat. * Offcuts lie in the grass. * A dead vine: a gnarled stem winds up the front-left post and along the top of the front beam, and dry tendrils hang from the rafters. * A few bare rocks lie about the summit. 2. Weathered timber (woodBox()). Each piece is a finely subdivided box pushed into the wood by grain-aligned noise, stretched along the length: * raised grain; * long checks (splits); * rounded, crumbled arrises; * rot at the post feet and the beam ends; * optional splintered ends, where each "fibre" stops at a different length.

Surface and material: * Vertex colours: silver-grey wood, dark in the cracks and the rot, damp-dark toward the ground, lichen on the upper faces. * Texture: a generated canvas with grain lines, knots and checks. * Material: roughness 1 and almost no reflection (envMapIntensity 0.08): a dull, dry surface. * Where the bees hang: weathering of the front beam's underside is capped at 0.02 ft into the wood, and it follows the sim's sag. * Wire look: the arbor uses a faint, translucent wireframe. 3. The sim and the picture use the same boxes. Swarm.arborBoxes() lists every solid part (posts, beams, rafters, slats) as an axis-aligned box. The renderer builds the timber from exactly these boxes, and the sim keeps flying bees out of all of them (_stone(), which now pushes out through the nearest box face). * Cosmetic only: the fallen rafter, the brace, the vine and the rocks are not solid. 4. Attachment. * _soffitY(x) is now the underside of the sagging front beam: attachY + beamSag·min(1, (dx/arborHalf)²), with attachY 9.0 ft. * _underArch keeps footholds 0.05 ft inside the beam's edges and 0.55 ft clear of the posts. * Steering: a bee arriving above the beam flies out past its front or back face and comes in from below, as it did for the arch. 5. The high place. The summit is now a polar mesh, fine near the arbor and coarse far away. 16–23 ft beyond the arbor, on the sea side, it breaks off at a ragged brink and drops in cliffs toward the Adriatic ~1,400 ft below. Steep ground is coloured as bare rock. * From the default view (the camera on the landward side): the arbor is seen against the sea and the brightening east, so the swarm is diffusely lit by the sky and backlit by the dawn. 6. Text. * Card: the queen alights "upon the grey and broken timbers of a forsaken bower high above the sea". * HUD: it now speaks of the arbor and the beam.

A determinism fix (_sim.js, Swarm.RING)

The foothold search pattern introduced in B1 was built with Math.cos / Math.sin. Those are not bit-identical between JavaScript engines, and in B1–B3 the browser's runs differed from Node's (each was self-consistent, so rewinds still matched). The pattern is now built from exact 30°/60° values and sqrt(3), plus two literal constants. Browser and Node now give the same hash.

C1 results (seed 3906, 7,500 bees, 20 °C; Node = Chromium)

t (s) flying / attracted / settled / fanning cluster (deep × along the beam) bees gripping the beam longest chain hash
60 5,557 / 461 / 1,482 / 191 4.4 × 5.1 in — 12 04cf6a44
120 0 / 4 / 7,496 / 1,130 5.4 × 8.2 in 911 16 e08b22d8
200 0 / 5 / 7,495 / 1,060 5.1 × 8.3 in 1,053 13 648fafb6
250 0 / 2 / 7,498 / 978 4.9 × 8.2 in 1,061 13 49061889

C1 verified (headless Chromium, SwiftShader, from file://)

Known limits (C1)


CT39.B3.Swarm context (still valid except where C1 changed it above)

The user's B3 request

Off in the distance is the adriatic · Remove all outlines from the stone · Remove most of the stones, except for the arch and some of the crepidoma · All stones should be severely degraded, both in terms of geometry and surface reflectivity · Remove all but one or two stars

"Outlines" is taken to mean B2's glowing symbol tracery on the stones. The bee outline switch (U, off by default) is unchanged.

What B3 changed (_main.js)

  1. The Adriatic. - Terrain: on the side facing the sunrise, the summit falls away in a steep slope beyond ~55 ft, so the sea is in plain view. - The sea: ~1,400 ft below (B2: 2,600 and mostly hidden), out to the horizon. It is a dark, rippled mirror (a generated normal map of small waves, metalness 0.85, roughness 0.16) reflecting the dawn sky, with a column of reflected glow running toward the viewer. - Islands: three low islands far to the north-east, as the Tremiti islands lie off Monte Gargano. - The near ridges stay open to the east.
  2. No symbols. All of B2's ~600 glowing decals and the symbol masks are gone. CT39.C6.Swarm_symbols.js is no longer shipped; the artwork stays in CT39.artwork.
  3. Almost all the stones are gone. - Removed: the altar, the wall fragment, the fallen attic blocks and the scattered stones. There were already no columns. - Left:
  4. Severely degraded stone (erodedBox()). Every stone is a finely subdivided box whose vertices are pushed into the stone by: - fine pitting; - rounded and chipped edges; - missing chunks (large-scale noise).

The push direction depends only on position, so faces stay joined. For the ring, the eroded box is bent into the half-annulus. - Surface: vertex colours put dirt in the hollows, darken toward the ground, add lichen patches and streaks. The material is fully rough and matte (roughness 1, no reflections, strong bump): no sheen at all. - Where the bees hang: soffit erosion is capped at 0.025 ft, always upward into the stone, so the sim's circle stays where the bees grip. The sim now keeps footholds 0.18 ft from the soffit's chipped edges and 0.35 ft from the springing (B2: 0.03 / 0.25). - Joints: the ring's feet run 0.35 ft down into the piers, so there is no gap at the springing. - Wire look: the ruins use a wireframe material, as the terrain does (no edge-line twins). 5. Sky. Only Venus (low over the sea, brilliant) and Jupiter (high south-east) remain, with the crescent moon. Orion, the Pleiades, Sirius, Mars and the background star field are removed.

Sim: only the foothold margins changed. With seed 3906 and 7,500 bees the results are identical to B2 (hash at 250 s 0d03ec0f; ~2,030 bees grip the stone, ~2.8 bee-weights each; the cluster is 4.2 × 11.5 in), because the cluster never reaches the edges.

B3 verified (headless Chromium, SwiftShader, from file://)

Known limits (B3)


CT39.B2.Swarm context (still valid except where B3 changed it above)

Browser simulation (WebGL + three.js r186, vendored; works from disk) of a honeybee reproductive swarm. The bees mill around, then hang from the stone underside of an arch at a ruined mountain-top sanctuary above the Adriatic, just before dawn.

The user's B2 request

Stars: Rigel, Betergeuse, Pleiades · Planets visible: venus, jupiter, mars · Crescent moon visible · No columns or partial columns · The arch can be much thinner, with no visible gaps between stones · Much more outlines visible on all flat stones, the outlines can be self illuminating · The close in viewport should have the camera lower, looking up · Start with more bees, 7500 · Start with outline off · The text viewport should take up less space, fewer lines by half

(The B1 request text was repeated above it unchanged.)

What B2 changed

  1. The sky (skyDir(), SKY_OBJ, updateSkyObjects() in _main.js). - Positions: real altitude and azimuth at 41.7° N (Monte Gargano), sidereal time 7.0 h (sun ~9° below the horizon), rotated so the sun's azimuth lies on the scene's eastern glow. - Objects: Betelgeuse (orange) and Rigel (blue-white) with the rest of Orion (Bellatrix, the belt, Saiph); the Pleiades (7 stars at catalogue positions); Sirius; Venus (low east, brilliant), Jupiter (high south-east) and Mars (reddish). - Crescent moon: recomputed from the same table, ~24° up near Venus. - Drawing: additive glow sprites, fixed size on screen. - Dawn fade: each object fades on its own schedule, Venus last. - Background: the procedural stars are fewer and fainter, so the named ones stand out; the moon's halo is smaller. - Accuracy: the planets' positions are plausible, not an ephemeris for a particular date (SCIENCE §4e).
  2. No columns. Every column, column stump, capital, architrave piece and fallen column drum is gone. What remains: the three-step platform, the fragment of cella wall, the altar, the arch, the fallen attic blocks and the scattered stones.
  3. The arch is slender and seamless. - Ring: one smooth stone with no joints; its inner edge is a true arc of 64 points. It is 0.75 ft thick (B1: 1.7) and 1.8 ft deep (B1: 2.2). - Keystone: slightly proud, its underside clamped to the soffit circle. - Piers: single dressed stones 1.3 ft wide (B1: 2.2) on plinths, with slim imposts. - The sim uses the same numbers: archDepth 1.8, archRing 0.75, pierW 1.3.
  4. Glowing symbols on every flat face. - Where: carve() tiles gold tracery over the faces of every worked block: arch piers and plinths, altar, platform steps (tops and risers), wall blocks, fallen and scattered stones. Each face gets up to 6 × 4 symbols, up to 3 ft each, picked at random from the four, top faces in random quarter turns. - The arch: 10 symbols follow the curve of each face of the ring, plus one on the keystone and a 7-ft plate in the temple floor. - Count: ~600 decals in total, merged into 4 meshes, one per symbol: 4 draw calls. - Material: metal gold, plus self-illuminated gold emission (1.7 in the dark, falling to 0.9 as dawn comes). - Blending: alpha-blended rather than alpha-tested, and the masks are thickened (3×3 max filter), so the fine lines fade softly with distance instead of vanishing. - Wire look: the symbols are drawn in both looks.
  5. Close-up from below: the small window's camera is now 31° below the cluster, looking up (B1: 7° above), kept at least 0.6 ft above the ground.
  6. 7,500 bees by default; the Bees selector now offers 500 / 1,000 / 2,000 / 4,000 / 7,500 / 10,000 / 12,000 / 20,000.
  7. Outline off by default (?outline=1 or U turns it on). Shaded, shadows, reflections and crystal wings stay on.
  8. Half-height status panel: six short lines, against B1's 12–13. - Line 1: run (seed, bees, time, direction and speed), dawn %, fps and ms. - Line 2: phase. - Line 3: cluster size and its grip on the stone. - Line 4: camera and lens. - Line 5: what is drawn, and the hash. - Line 6: recording. - The odometers are unchanged.

B2 results (seed 3906, 7,500 bees; Node)

t settled cluster (deep × wide) gripping the stone load on each top bee (bee-weights) longest chain
60 s 1,596 4.1 × 5.7 in 289 4.7 10
90 s 6,144 5.4 × 9.2 in 1,047 5.1 18
150 s 7,496 4.3 × 11.4 in 1,935 3.0 15
250 s 7,497 4.2 × 11.5 in 2,030 2.8 14

B2 verified (headless Chromium, SwiftShader, from file://)

Known limits (B2)


CT39.B1.Swarm context (still valid except where B2 changed it above)

B series, first version. Browser simulation (WebGL + three.js r186, vendored locally; works from disk) of a honeybee reproductive swarm: the bees dash around madly, then gather and hang as a living cluster under the stone arch of a ruined mountain-top sanctuary above the Adriatic, just before dawn.

Harness: Claude harness v2 (2026-09-27). Built 2026-10-06. Built on CT39.A12.Swarm, the highest A version, which lives at C:\Users\micha\Downloads\claude\CT39.A12.Swarm\. * Kept from the A series: - the deterministic simulation (scent field, each bee's own decisions, landing on contact, hanging chains with grip loads, strands); - the sound; - the two views (wide shot plus a small close-up), the camera that always aims at the queen, with drag to orbit and the wheel for distance; - the metal-plate UI with gold status type, rewind and recording. * Replaced: the world, the look of the bees, and the opening. * Science: CT39.C6.Swarm_SCIENCE.md (+ .html). New for B1: §4d (the stone arch, the climbing rule, a dawn note, sacred bees) and §5b (the metal bees).

The user's B1 request (abridged)

CT39.B1.Swarm. … the 3D environment and visual design has changed. The locale is … an ancient setting, possibly the adriatic, at an abandoned sacred site, at altitude. It is just before dawn, the sky is lightening, and the moon is still visible. There are the remains of an ancient stone altar and some ruins of a temple … there is an arch that would provide a base for the queen to attach to and for the swarm to form around. The illumination is all natural … the swarm is diffusely lit from the sky and is occasionally backlit. The ruins, the altar and the foundation have embedded in them designs and hieroglyphs barely visible that contains esoteric symbology … a cult of mechanical and divine swarms. Artwork … "swarm outline 2-5" … This symbology and the bees themselves are made of metal. The honeybees … metallic, with alternating narrow stripes of black and broader stripes of gold. The wings are … very thin and semi-transparent crystal. The five eyes of the bee are red. The outline of the bee is also rendered … The user interface should make it possible to turn on shading vs wireframe, turn on or off shadows, and other shading elements, such as the reflectivity (reflection mapping) of the metal. By default, shading, shadows, reflectance mapping and bee outlines should be enabled. … The web program begins with the title card artwork, which holds for 15 seconds, and then fades to the text that describes in arcane language the nature of the reproductive swarm, the deposed queen, and the loyal drones. … Bees land wherever they touch the growing cluster and either start a new chain or add themselves to an existing chain. There are two viewports … The camera is always pointed at the queen … mouse to orbit … scrollwheel … The second viewport is much smaller and is a closeup … The status … in gold type … audio … The opening splash / title card should be "swarm 9.webp" …

The request gives the title 15 s in one place and "about 10 seconds" in another; 15 s is used.

What B1 does

Opening

  1. Title card. CT39.C6.Swarm_title.webp (copy of CT39.artwork\swarm 9.webp, 816×1456) fades in and holds 15 s.
  2. Story card. It fades to the CT46-Zoltar-style card (velvet, gold frame, Metamorphous lettering): - heading ✦ LIBER EXAMINIS · FOLIUM PRIMUM ✦, title Of the Queen Deposed and the Faithful Swarm; - new arcane text: the hive dividing like a seed, the new sovereign, the mother-queen deposed and exiled, the daughters and the drones following her, waiting for the seekers to find a hollow; - it holds 32 s.
  3. Scene. The card fades, the dawn scene fades up, the bees' sound rises, and the simulation starts.
  4. Controls during the opening: the first click wakes the sound; later clicks, or Space / Enter / Esc, skip ahead. URL: ?intro=0, ?title=, ?card=.

The world (_main.js, "B1: an abandoned sacred site")

Everything is generated in code except the inlaid symbols. * Sky. A shader dome: deep-blue twilight, a warm glow along the eastern horizon (over the sea, a little left of behind the arch from the default view), a rose band above it, and stars that fade as it brightens. - Dawn follows simulation time: from 0 (sun 12° below the horizon) to 1 (1° below) over 300 sim-seconds (?dawn=). Movies are therefore identical on any PC, and rewinding darkens the sky again. - Moon: a waning crescent ~12° up just south of the glow, its lit limb toward the hidden sun, with a faint earthshine disc and a halo. * Light (all natural): - sky light (hemisphere, bluish, growing with dawn); - the glow of the east: a warm directional light from 5–8° above the eastern horizon. It casts soft shadows (4096² map, PCF radius 4) and is the light that backlights the swarm from the default view; - faint moonlight. - ACES tone mapping, exposure 1.45, and exponential fog whose colour follows the dawn. * Reflections. The sky alone, plus a dark ground, is pre-filtered into a PMREM environment map. It is rebuilt each time dawn advances 3 %, and every metal reflects it (bees, inlays, crystal wings, sea). * Land. - A summit plateau of thin turf and rock, flat at the shrine, falling away beyond ~180 ft. - Two rings of ridges: the near one below eye level, far inland mountains to the west, north and south a few degrees above it. Both open to the east. - The sea far below to the east, catching the glow. * Ruins (rough limestone, procedural texture with bump, soft lichen, cracks): - The arch: two ashlar piers with plinths and impost mouldings, and a ring of 15 voussoirs with a proud keystone. Its two attic blocks have fallen to its feet. - The arch's stone is exactly the sim's: soffit radius archR 4 ft about (siteX, attachY − archR), crown 11 ft up, depth 2.2 ft, ring 1.7 ft, piers 2.2 ft wide. The voussoirs' undersides are true arcs. - The altar: a moulded block (base, die, cornice, cracked top slab) 11 ft in front of the arch, with a few fallen offerings. - The temple behind the arch: - a three-step stylobate with fluted column stumps; - four standing columns with capitals, an architrave on two of them and a beam askew on a third; - fallen drums, a fragment of the cella wall, and scattered ashlar. * Inlaid symbols (CT39.B2.Swarm_symbols.js, data URIs): - Masks are made from "swarm outline 2–5.webp": the engraved gold lines of each plate are extracted (high-pass on brightness and warmth), de-speckled, and stored as 512² greyscale. - They are drawn as thin gold metal tracery set into the stone: alpha-tested decals, metalness 1, roughness 0.42, extra reflection. - Placed on both faces of both piers, the keystone, the altar's front, sides and top, six small plates along the stylobate riser, and a large plate in the temple floor. - Barely visible by design: dark in shadow, catching glints of the sky when Reflections are on. - (CT39.artwork also holds "swarm outline 1" and "swarm 1–10"; only 2–5 and 9 are used, as asked.)

Sim changes (_sim.js; STRIDE 23 unchanged)

The bees (_main.js, "B1: metal honeybees")

UI

B1 verified (headless Chromium, SwiftShader)

Known limits (B1)


A12 context (still valid except where B1 changed it above)

What A12 changed (user's request)

There should be a button to toggle between wireframe & shaded. There should be a button to turn shadows on or off. I would like to start with fewer bees and see if it affects performance substantially. There should be lest debris, sofas, whatever in the empty lot. If shaders are working it would be nice to render the bees with an outline shader.

"lest debris, sofas, whatever" could be read as less or as lots. Because it names sofas, which the lot didn't have, I read it as more, and made the amount switchable so both readings are covered.

  1. Look: wire / shaded (W / Look button; ?look=shaded). Wireframe (A11) is the default. - Every prop has both forms. Each solid keeps its shaded mesh and gets an edge-line twin; applyLook() shows one set. The shaded look brings back A10's textured ground and oil stains, the sun, sky light, streetlight spot, metal reflections and filmic tone mapping. The wire look shows A11's dark ground and grid. - Bees:
  2. Shadows (Q / Shadows; ?shadows=0). The sun's 4096² shadow map, redrawn for each view. They only appear in the shaded look, so the button is dimmed in wire. Off means no shadow passes at all.
  3. Bee count. - 4,000 by default (A5–A11: 12,000). - The Bees selector in the header offers 500 / 1,000 / 2,000 / 4,000 / 8,000 / 12,000 / 20,000. Changing it reloads the page with ?bees=N, skips the opening, and keeps the look, shadows, outline and junk settings. - FPS odometer (new, first in the row) and a HUD line: the look in use, 1 or 2 views, the junk setting, frames drawn per second (the loop is capped at 30, the film rate, so 30 = full speed), and the average milliseconds to prepare and submit a frame.
  4. Junk (J / Junk button; ?junk=lots|some|none; default lots). - some = A10's set: the car hulk, tyres, oil drums, pallets, refrigerator, cinder blocks and scrap heap. - lots adds:
  5. Outline shader (U / Outline; ?outline=0; ?outlinew= sets the width, default 0.035 body lengths). It is an "inverted hull": the bee body drawn a second time in black, back faces only, pushed out along its normals in the vertex shader. That gives a black rim around each bee's silhouette. It shares the bees' instance matrices, so it costs one extra pass of the bee bodies. It is drawn in the shaded look only.
  6. Keys: W look · Q shadows · U outline · J junk (in addition to A11's keys).

A12 verified (headless Chromium, SwiftShader, from file://, 4,000 bees)

What to expect for speed (rough guide, not measured)

Known limits (A12)


A11 context (still valid except where A12 changed it above)

What A11 changed (user's request)

The legend / fortune card before the simulation starts should hold longer. The type that describes the status should be larger and the color should be metallic gold. The camera of the window that is close up on the swarm should be further away from the queen. The color scheme of the bees should be striped black and red. The renderer should be wireframe as we need a better frame rate.

  1. Story card holds 32 s (A10: 18 s). ?card=<s> still overrides it, and Space / Enter / Esc or a second click still pass on.
  2. Status type (HUD). Raised from 11 px/16 px to 15 px/22 px, in metallic gold: a polished-brass gradient that repeats on every 22-px line, with a dark drop shadow and a faint warm glow. The long "hanging chains" line now wraps onto two lines. The odometer drums are unchanged.
  3. Close-up window camera is further back. - It stands 5× the cluster's size away (A10: 2.2×), clamped to 1.8–18 ft (A10: 0.6–8). - Before a cluster exists it frames the queen as if the cluster were 0.6 ft (A10: 0.3), i.e. 3 ft away. - At t = 100 s it stands ≈ 2.8 ft from the cluster. The A10 lens (32°) and orbit (one turn every ~57 s) are unchanged.
  4. Bees striped black and red (vertex colours): - the abdomen is banded along its length, alternating black / red every 0.09 of the body length, with a black tip; - the thorax and head are black; - the eyes are still small, self-lit and pale; - the wings are outlines only by default; ?wingfill=1 brings back the faint membrane. - The strand-contrast view (N) scales how bright each strand's red is; the chains view lights the longest chains in bright red. - Real honeybees are amber and black, not red (SCIENCE §5a).
  5. Wireframe renderer. - Removed: the shadow map (it was rendered twice per frame, once per view), the sun, sky light, spotlight and metal reflections, and tone mapping. - Materials: all unlit, no lighting. - Props: every solid in the lot is replaced by its edges (creases over 25°), in a grey matching its old shade. The chain-link fence becomes a diamond lattice of lines. The poles, line, streetlight, junk and hive are all wire. - Ground: a flat dark-grey plane under a wire grid (5-ft squares near the site, 25-ft to the horizon). - Background: the grey sky dome is kept, so the black stripes show. - Lamp: the streetlight's lit glass and halo are kept. - Bees: low-poly wire bodies, about 100 triangles against ~280 in A10. - Draw passes: each frame draws 12,000 bees 2 times (wide view + close-up) instead of 4. - Removed URL options: shadow= and lampshadow=.

A11 verified (headless Chromium, SwiftShader, from file://)

Known limits (A11)


A10 context (still valid except where A11 changed it above)

What A10 changed (user's request)

When the program starts, the main title card is displayed for about 10 seconds, then it fades and is replaced by a card in the style of CT46 Zoltar that says in arcane language that refugees from a hive have been expelled from the home that they had built and, with their deposed and exiled leader, their queen have embarked on a journey to find a place for a new home. This card also fades and the audio sound of the bees becomes audible, and the 3D background becomes visible, an empty lot with one streetlight, such as you might find in a junk yard a power line, sagging, that runs across the lot. This power line is the anchor to which the bees will follow the scent and create a temporary home. At this point the simulation begins. Instead of using color to reveal the chains of living bees, perhaps we can use contrast or varying intensity to outline the chains. There are two windows, one containing a wide shot of all the bees, and one a much smaller window which is close up on the emerging swarm architecture. The bees are represented by a simple geometry of a main body, a head, two eyes and two wings. The wings are transparent or perhaps just an outline of the geometry. The rest of the bee body appears to be made out of iron. The bridge, metal arch, whatever can go away. The rendering should be shaded and cast shadows.

The A9 prompt's cut-off line turned out to be: "The bees themselves should be luminous, like a mystical life form that is self illuminated." A10's iron bodies take precedence; the luminous idea survives as self-lit eyes.

1. Opening (runIntro in _main.js, #title / #card in the page)

2. The lot

Everything is generated in code; there are no model or texture files. It is a junk-yard lot, monochrome. * Ground. Packed dirt and gravel (a canvas noise texture) with oil stains. * Fence. Chain-link at the back and sides, alpha-tested so it casts a lattice shadow. * Junk. A stripped car hulk on its sills, a tyre stack and loose tyres, oil drums (one on its side), a stack of pallets, a dumped refrigerator, cinder blocks and a scrap heap. * The hive they left, ~100 ft off. * The streetlight. Tapered steel pole, curved arm, cobra-head lamp with a lit glass and halo, and a spotlight on the ground below. It casts no shadow by default; ?lampshadow=1 turns it on. * The power line. Wooden poles with crossarms, braces, porcelain pin insulators, and a transformer can on the right-hand pole. Two conductors run 84 ft between poles, with an extra span each side, and sag 12 ft: 24 ft up at the insulators, 12 ft at mid-span over the lot. The swarm hangs from the front conductor (0.72 in across) at the bottom of the sag. * Light. - Low late-afternoon sun: a directional light that casts the shadows (4096² map over ±55 ft; ?shadow= sets the size). - Sky fill from a hemisphere light; a grey sky dome brighter toward the sun. - ACES tone mapping and fog. - Metals (bees, conductors, steel) reflect a generated, pre-filtered grey environment; dirt, wood and stone don't. * Removed: the arch, the A4–A9 wireframe grid and the black void.

3. Sim changes (_sim.js; STRIDE 23 unchanged)

4. Iron bees (beeBody, beeEyes, beeWingRim, beeWingFill in _main.js)

5. Strands by contrast (N / Chains button)

?strands=contrast|chains|off sets the starting view. * contrast (default): each strand's iron gets one of 5 brightness levels (×0.12, 0.38, 0.75, 1.2, 1.8), chosen by a golden-ratio sequence of its top bee, so neighbouring curtains differ. Eye glow follows the level; the queen's strand is brightest. * chains: the 16 longest chains are bright iron with white lines along them; all other hanging bees go dark and shrink to 40 %. * off: plain iron. * G grips are drawn in grey at the strand's level. K load and C caste shading are still available.

6. Two windows

7. UI

A10 results (seed 3906, 12,000 bees, 20 °C; Node)

t settled cluster (long × wide) strands
45 s 508 4.7 × 2.3 in 40
60 s 2,055 6.8 × 3.1 in 87
75 s 5,622 8.4 × 4.1 in 119
90 s 10,920 7.8 × 5.1 in 157
150 s 11,999 5.0 × 6.0 in 168

A10 verified (headless Chromium, SwiftShader)

Known limits (A10)


A9 context (still valid except where A10 changed it above)

What A9 changed (user's request)

The swarm should hang from a cast iron arch, such as might have been used to build a bridge in England in the 19th century. The text should appear to be mechanical, and made of metal. It would be nice if the individual strands of bees could be more clearly visible, possibly through a color per strand? Th…

(The request ended mid-word at "Th"; whatever came next was not received.)

1. The cast-iron arch

bridge in _main.js, geometry parameters in the sim's DEFAULTS. * The bridge. A Telford-style road bridge modelled on the type of Cantlop Bridge, Shropshire, 1818 (SCIENCE §4b): - one 31-ft segmental span, rise 6 ft, intrados radius 23 ft; - 4 lattice ribs, 4 ft apart, each with bottom and top chords and an X-lattice web, cast in 5 segments with bolted flange joints (none at the crown); - 5 transverse members, X-braced between the ribs; - ring spandrels with vertical standards and a deck bearer; - cambered cast-iron deck plates; - railings with a top rail, dog-rail, dog-bars, posts and end balusters; - sandstone ashlar abutments with a string course, cast-iron skewbacks and road embankments. * Where the swarm hangs. Under the crown of the front rib, which faces the camera. The bees grip its half-round bottom bead (radius 0.09 ft). * Sim changes (STRIDE unchanged at 23): - _axisY(x): the bead's centre line, a circle of radius archR. - _branchGap, _branchFree, the grip pass, the solid-iron pass and the climb onto free iron all use the local height of the bead at each bee's x. A8 used a straight branch. - Flying bees collide with the deck slab and the two abutments: pushed out of the nearest face, heading reflected. The lattice ribs and spandrels are open; only the front bead is solid. - A scent-following bee above the deck flies out past the front edge and drops below it before going in. - New DEFAULTS: archR 23, archSpan 31, ribDepth 1, ribs 4, ribPitch 4, deckThick 0.35, deckOver 0.25, deckCamber 0.0044, abutOut 22, deckEdge 0.7. * Looks: T / Arch button cycles three modes: - wire (default): hidden-line wireframe, with a black fill so the ironwork hides what is behind it, grey edges and masonry joint lines; - iron: shaded grey cast iron and sandstone, lit by a hemisphere light, a sun and a fill light; - off: hidden. - URL: ?arch=wire|iron|off.

2. Colour per strand

3. Mechanical, metal text (CT39.B1.Swarm.html)

A9 results (seed 3906, 12,000 bees, 20 °C; Node)

t settled cluster (long × wide) strands longest chain
45 s 828 4.6 × 2.9 in 102 12
60 s 3,390 6.7 × 4.2 in 226 18
75 s 8,410 8.2 × 5.3 in 349 25
90 s 11,970 7.3 × 6.0 in 427 21
150 s 11,998 4.8 × 6.0 in 442 13

A9 verified (headless Chromium, SwiftShader)

Known limits (A9)


A8 context (still valid except where A9 changed it above)

What A8 changed (user's request)

When in auto mode, the camera should aim for the queen, and should not constantly jiggle around. When not in auto mode … the camera will orbit around the swarm/queen. The user should be able to adjust the distance from the queen/swarm. The program should begin by displaying the artwork hive_title.webp … then repositioning to the lower left, at which point the simulation begins. There should be audio that is the sound of the bees.

  1. Camera: AUTO (default; A key / Camera button). Same POV as before (fixed at 6 ft up, (0, 6, 0)), but the aim is the queen (bee 0) instead of the median of sampled bees. Why it jiggled before: the aim was a median of ~700 moving bees and the zoom was the 90th percentile of their spread, both chased at α = 0.07 per frame. Now: aim = queen through a critically damped spring (ω 1.1 rad/s, ~1 s settle); zoom = spring (ω 0.7) with a 10 % dead band (it only re-targets when the framing it wants is clearly different). Springs run per film frame (1/30 s), so recorded movies are the same on any PC. Z (auto-zoom) still works in AUTO.
  2. Camera: ORBIT. Circles the queen (aim still the smoothed queen). Drag on the picture = orbit (horizontal → bearing, vertical → elevation −14°…83°); mouse wheel, the Distance slider (1–250 ft, log scale) or [ ] = distance (eased with a spring); O / Orbit spin = slow automatic orbit (0.06 rad/s, ~1¾ min per turn, only while running). Dragging or touching the slider in AUTO switches to ORBIT starting from where the auto camera was. Lens fixed at 50° in ORBIT; near plane shrinks with distance (min 0.02 ft) so you can get within inches. Camera never goes below 0.4 ft. URL: ?cam=orbit&dist=20.
  3. Ground grid now covers all sides of the site (±60 ft at 5 ft, ±400 ft at 25 ft), cut into one segment per square so no line crosses far behind the camera (the A4 clipping problem).
  4. Title. CT39.B1.Swarm_hive_title.webp (copy of CT39.artwork\hive_title.webp, 816×1456 portrait) fades in filling the view on black, holds 3.2 s, then glides (1.6 s, CSS transition) to the lower-left corner at 24 % of the view height while the black backdrop fades; then the simulation starts (it is paused during the title). Click or any key skips ahead. I hides/shows the corner logo. ?intro=0 skips the title. The logo is HTML, like the HUD, so it is not in recorded movies.
  5. Sound (Sound module in _main.js, Web Audio, synthesised — no sound files, no internet). Details and sources in SCIENCE §7b. Cloud chorus (10 buzz tones 196–256 Hz) + band-passed wing noise (260 Hz) + faint 5 kHz hiss, level (√flying + 0.35√settled)/distance; 16 voices on the nearest flying bees (pitch by caste/size, 1/d loudness, stereo by screen side, Doppler from velocity × sim speed × direction). Silent while paused; fades on Finish. Browsers block audio until a click/key: the first click or key anywhere starts it (the button says "Sound (click page)" until then). M / Sound button mutes; Vol slider. ?sound=0 starts muted.
  6. Server: .webp MIME type added. HUD: a camera line (mode, distance, bearing, elevation).

A8 verified (headless Chromium, SwiftShader, from file://, 3,000 bees)

Known limits (A8)


A7 context (still valid except where A8 changed it above)

What A7 changed (user: "Can we implement this: settled bees are spheres that slide, rather than bees hanging from one another in chains. Then what happens after this?")

  1. Grips in the state. STRIDE is now 23. - Slots 18–20: up to 3 grips (−1 none, −2 bark, else a bee index). - Slot 21: load held (bee-weights, refreshed every relaxation tick). - Slot 22: grip strength, drawn per bee from 35 ± 14 bee-weights (Shishkov et al. 2022), clamped to 8–80. - this.wgt[i] is the bee's weight in mean-worker units, by volume. - Grips live in the state, so checkpoints, seek and the hash cover them.
  2. Holds. A bee may hold the lower half of the branch (barkBand 1 = up to the axis), one bee per spot (0.9 contact), or settled bees above it. - holdBelow −0.1: the held bee must be at least 0.1 link higher. - A bee can be held by at most maxHeldBy 4 others, counted from the state by _holderCount (determinism). - A landing bee that can't take any hold doesn't land (_settle returns false) and keeps flying.
  3. Links = body length. Centre distance ≤ ½(Lᵢ + Lⱼ)·linkBody (≈ 13 mm). Searches use ±2 cells of the 0.035-ft hash. Contact-length links collapsed the network into a crust.
  4. Relaxation every 16 steps (7.5 Hz), P.relaxEvery (RELAX_EVERY export = 16):
  5. drop holds on bees that flew off;
  6. _topology(): BFS from bark-holders gives depth and order; loads are passed up, shared equally among supporting holds;
  7. orphans re-grip or fall (they fly back);
  8. each bee has a 2 % chance per tick to re-grip:
  9. gravity (sag 0.016 ft per tick) plus a slow sideways crawl toward the queen;
  10. 2 × [grip pass top-down in BFS order, then a Gauss–Seidel half-stencil overlap pass]. Bark-holders and the queen are anchored. The last pass is overlap, so bees never end a tick inside one another.
  11. Bark taken only under strain. _branchFree allows a new bark spot only while the cluster is founding (< 40 bees), or next to bark-holders carrying > barkComfort (0.25) × their grip strength.
  12. Renderer. - K (button Load) shades bees by load ÷ grip strength. - G (button Grips) draws the grip links as grey line segments; live state only, hidden while rewinding. - HUD line: bark-holders, mean top load vs grip strength, longest chain, number over their grip. - Phase 4 text reads "clustered, hanging in chains". - clusterShape().load carries the stats.

A7 results (seed 3906, 12,000 bees, 20 °C)

A7 verified

Known limits


A6 context (still valid except where A7 changed it above)

What A6 changed (user's request, from my own A5 review)

"The queen and the first settlers give off a scent that spreads through the air; each bee follows the scent toward its source and steers by reacting to its neighbours; bees land wherever they touch the growing cluster." All three done — nothing is scripted any more (no join times, no pre-assigned slots, no prescribed cluster shape or size): 1. Scent field: 64×28×64 grid of 1-ft cells around the site; explicit finite-difference diffusion (2 ft²/s) + decay (0.08/s) every 1/30 s; ground reflects. Sources: queen (0.35 flying, 1.0 settled), fanning surface bees (0.03 each, 35 % of surface bees, emitted 1 ft outward = fanning away from the queen, Nguyen et al. 2021 PNAS). S shows a slice. 2. Each bee: own threshold (threshold × (0.3 + 5.7u²), threshold 0.05); above it → attracted → turns up the trilinear scent gradient (gain 9); within 1.5 ft of the cluster edge flies at it. Neighbours: separation < 3 in (1-ft hash of flying bees), cohesion to the centre of mass of bees within a ~12-ft block (4-ft density cells), and stay-with-the-swarm turn-back beyond 0.7 × cloud radius around the flying centroid; radius ∝ cbrt(flying/total). 3. Landing on contact: fine hash (0.035-ft cells) of settled bees; attracted bee lands touching the first settled bee it meets (contact = (ri+rj)·spacing, spacing = cbrt(0.6/packing)). Queen mills to 12 s, then alights under the branch. 4. Cluster physics (every 1/15 s): crawl toward the queen (0.25/s sideways, 0.0085/s vertical, ≤0.02 ft/s), two Jacobi overlap-resolution passes (queen anchored), branch collision, surface detection (neighbours < 0.7 × mean) → fanning; surface bees re-launch with p = 0.0004 per tick and may not re-land for 2–6 s (a few dozen bees always flying). - Results (seed 3906, 12,000 bees, 20 °C): settled 9 % at 45 s, 33 % at 60 s, 94 % at 90 s, 99.6 % at 150 s; cluster ≈ 8.3 in long × 4.5 in wide, measured packing ≈ 0.6; cloud ≈ 35–40 ft across while milling. - Removed: ?shape=sphere, ?dia=, ?gather= (nothing to set — it emerges). Added: ?threshold=, ?fan=, ?temp=. - Performance: ≈ 4–6 ms per 1/120-s step for 12,000 bees in Node (≈ 20–25 ms per film frame at x1) — about real time on a normal PC; recording is frame-locked so movies are unaffected. Optimisations kept: staggered (1-in-4) smell / cohesion / separation checks, face-aware neighbour cells, cache-friendly symmetric pair loop for the cluster, relaxation at 15 Hz. - Determinism: checkpoints now also store the scent field (+ surface flags); the cluster hash is rebuilt after every relaxation (index order) — required for exact backward seeking (verified: re-seek and fresh-run hashes identical). - Renderer: HUD shows census (milling / following scent / settled / fanning), emerged cluster size; branch always on (T toggles); shading and auto-zoom use the live cluster; S scent slice (grey dots, brightness ∝ (c/max)^¼).

A6 verified

Node: full run 0–180 s (numbers above), determinism (re-seek + fresh). Headless Chromium from file://: t = 1, 45 (+ scent slice), 90, 150 s — no console errors; through the server: forward, backward (rewind cache), pause → hash equals a fresh simulation; Finish & Make Movie wrote an MP4 and deleted the frames.

Known limits (see SCIENCE.md 6.5)

Tuned (not measured) emission/threshold/gain values; time still compressed ~8×; smooth scent (no turbulence/wind); queen's landing spot given; settled bees slide as spheres (no hanging chains); no thermoregulation, scouts or lift-off.


A5 context (still valid except where A6/A7 changed it above)

What A5 changed (the user asked "is the 1-foot sphere accurate?", then "all of the above")

The "foot across" came from the user's own prompt ("perhaps a foot in diameter"), not from research. Checked against the literature it is too big for a normal swarm, and real clusters hang as a beard, they do not hover. A5 does all three fixes: 1. Beard hanging from a branch (default). Branch shown by default (T still toggles it); the limb's underside is at attachY = 8.6 ft. Profile: clings along the branch at 0.75 of its greatest width, widest 30 % down, tapers to a blunt tip; cross-section 1.1 × 0.9 (along × across the branch); length = 1.6 × width (beardAspect). Grows from the queen's spot just under the branch outward/downward. ?shape=sphere restores the hovering ball (centred 8 ft up). 2. Size computed from the bees: cluster volume = Σ(equal-volume bee spheres) ÷ packing fraction. Packing from Ocko & Mahadevan 2014 (0.2–0.8) and Heinrich's ~2× volume change 15→30 °C: packing = 0.6 at 15 °C → 0.3 at 30 °C (clamped). ?temp= sets the air temperature (default 20 °C → 0.50). ?dia= still forces a sphere of a given size (HUD then shows the resulting packing, e.g. 0.10 for 1 ft — implausibly loose). 3. Typical size by default: 12,000 bees (≈1.4 kg, Seeley's ~1.5 kg swarm) at 20 °C → 3.0 L: beard ≈ 9.8 in long × 6.1 in wide (sphere mode ≈ 7.0 in). 12 °C → 8.9 × 5.6 in; 30 °C → 11.6 × 7.2 in. - HUD shows shape, dimensions, litres, packing, temperature and kg of bees. - Sim changes: _geometry() (size/shape/centroid; P.siteY becomes the centroid so the cloud and swirl centre on it), deterministic cbrt() (Newton, + − × ÷ only — Math.cbrt is not guaranteed bit-identical across engines), beardProfile(u), castes are now drawn in a first pass and positions in a second → different swarm than A4 for the same seed (still deterministic: repeat runs give identical hashes, e.g. seed 3903/12,000 bees at t=150 s → ce17be0a). - Renderer: branch placed from sim.cluster.attachY; ball shading and the auto-zoom limit use the cluster's own width/length.

A5 verified (headless Chromium, SwiftShader; Node)

Node: 12,000 bees to t = 150 s → 11,756 clustered + 244 fliers, cluster bees between y 7.88 and 8.61 ft (hanging under the 8.6 ft branch); repeat run identical hash. Browser from file://: t = 1, 85, 150 s (beard) and ?shape=sphere at 150 s; no console errors. Recording/rewind code unchanged since A3.


A4 context (still valid except where A5 changed it above)

What A4 changed (user's requests) — kept in A5

  1. Trees removed. (Hive kept as a wire box ~100 ft away; the optional branch, T, stays — off by default.)
  2. Black and white. Black background, white/grey lines only; no lights, no shadows, no colour. Distant lines fade to black (fog 45–230 ft). Caste toggle (C) now uses grey levels: workers dim, drones bright, queen pure white.
  3. Wireframe. Ground = line grid (5 ft squares near the site, 25 ft to the horizon, built only in front of the camera — GridHelper lines that cross behind the camera vanished in testing). Hive = box edges. Branch = wireframe cylinders. Bees = 20-face wire icospheres with a black "hidden-line" core (polygon-offset), so front bees hide the wires behind them. The bees in the ball get a grey light term (light from upper right/front) so the ball reads as a sphere of wire dots, not a flat white disc.
  4. Bees much smaller, still varying. Spheres now have the same volume as the bee's body (ellipsoid L×W×W): d = (L·W²)^⅓ → worker ≈ 6.1 mm (range 4.8–7.2 mm), drone ≈ 7.8 mm, queen ≈ 7.6 mm — vs A3's d = L (≈ 13 mm). Width/length used: worker 4.2/12.8, drone 5.5/16, queen 4.8/19. "Visible size" minimum lowered 2.5 px → 1.2 px. L (or the "Bee size" button, or ?size=length) switches back to A3's body-length spheres. Simulation (CT39.A6.Swarm_sim.js) is unchanged from A3 — same seed gives the same swarm and the same state hash.

A4 verified (headless Chromium, SwiftShader)

file:// at DPR 1 and 1.5, 10,000 bees: screenshots at t = 1, 62, 85, 150 s (wide wire cloud over the grid → shaded wire ball at ~400 mm); C / T / Z / L toggles; no console errors. Sim, rewind and recording code paths are unchanged from A3 (verified there: exact resume hash, MP4 made, frames deleted).


A3 context (still valid except where A4 changed it above)

Lineage

How to run

Controls

Key / button Action
F / → · B / ← · Space forward · backward · pause
+ / ↑ · − / ↓ faster / slower (x¼ … x16; x1 = real time)
R reset to t = 0
Z auto-zoom lens on/off (off = fixed 60°)
E visible-size exaggeration on/off (off = every bee at true size, sub-pixel when zoomed out)
C caste shades (A4: greys — queen white, drones bright, workers dim)
N chains: strands by contrast / 16 longest chains lit / off (A10; A9 used colour)
P close-up window on / off (A10)
H hide/show the HUD (the HUD is HTML, never in the movie)
A camera AUTO (6 ft up, aimed at the queen) ↔ ORBIT (A8)
drag · wheel · [ ] orbit · distance · distance (A8; switches to ORBIT)
O slow automatic orbit (A8)
M · Vol slider sound on/off · volume (A8; first click/key enables audio)
● Recording / ■ Finish & Make Movie as A1 (server only)

What happens (default seed 3903, 10,000 bees)

Sim time Phase (shown in HUD)
0–12 s Milling cloud ~37 ft wide, 16 ft tall; bees swerve erratically at 4–24.6 ft/s. Lens ~32°.
12 s Queen alights at the site (8 ft up, 40 ft from the camera).
~20–110 s Condensing: workers peel off and spiral in; the ball grows from the centre out along an S-curve; the cloud shrinks; the lens zooms in.
~110 s → Clustered: ~98 % in the 1-ft ball (true-size spheres, ~400 mm telephoto); ~2 % keep circling.
Real clustering takes 10–20 min; it is compressed ~8× (flight itself is real-time). Use ?gather= to change.

Files

File Purpose
CT39.B1.Swarm_hive_title.webp A8 title artwork (from C:\Users\micha\Downloads\claude\CT39.artwork\hive_title.webp).
CT39.B1.Swarm.html Page, buttons, HUD; loads the three scripts below. Canvas renders at a fixed W×H (movie size) and is scaled to the window with object-fit: contain (DPR-safe).
CT39.C6.Swarm_sim.js Deterministic simulation core (window.CT39Sim; also require()-able in Node for testing). All parameters in DEFAULTS with their sources.
CT39.C6.Swarm_main.js Scene, bees (one InstancedMesh of icosphere spheres), auto-framing camera, rewind cache, controls, frame capture.
CT39.C6.Swarm_server.py A1's server (label changed): static files, /api/frame, /api/new_take, /api/finish (ffmpeg), Range requests for playback.
CT39.C6.Swarm_start.bat / .sh Launchers.
CT39.C6.Swarm_lib/CT39.B1.Swarm_three.r186.min.js three.js r186 as a classic script (window.THREE), esbuild IIFE bundle (same build as CT46). MIT licence alongside.
CT39.C6.Swarm_SCIENCE.md / .html The biology, sources, and the model-vs-nature table.
CT39.B1.Swarm.md / .md.html This context file.

Key technical decisions (reuse in A4+)

Verified (headless Chromium, SwiftShader WebGL)

Ideas for A4


Context inherited from CT52.A2.SphereSwarm (option 5)

(File names below are the CT52.A2 names.)

CT52.A2.SphereSwarm — context file

This is a browser simulation (WebGL and three.js r186, bundled locally, so it works from disk) of a honeybee swarm. It does not hang from anything. The queen hovers in the open, and about 5,000 bees fly in a close ball around her, ~15 in across. New in A2: * a Move queen button sends her slowly 10 ft to the right, next to a 10-ft measuring pole, and a second press sends her back; * a Follow switch picks how the bees keep with her: by sight or by her scent alone.

The user's A2 request

(The A1 request was repeated above it and is quoted in the A1 section below.)

In this version there should be a button, that when clicked, causes the queen to move 10 feet or so to the right (or whatever). There should be a pole near to that new position, vertical, maybe 10 feet high, 1 inch in diameter, and with a band every foot that could be used to estimate height and size. When the button is clicked, the queen should move in the designated direction reasonably slowly and we will see what the other bees do. FWIW Many years ago, I observed the original large swarm, I observed a sphere of dense bees, and I observed a similar sphere in a different position. I did not see the swarm move, nor did I see the smaller sphere coalesce.

What A2 changed

1. Move queen (button, or G)

2. The measuring pole

3. Follow: sight / scent (button; reloads with ?follow=)

4. HUD

A2 results (seed 3906, 5,000 bees; Move pressed at 150 s; Node = Chromium)

The ball is measured about its own centre, so a ball lagging behind the queen is not counted as "big".

t (s) queen x (ft) sight: ball centre to queen sight: 90 % within (of the centre) scent: ball centre to queen scent: 90 % within (of the centre)
150 (press) 0.0 0 in 7.8 in 10 in 7.4 in
154 2.9 1 in 7.7 in 20 in 7.4 in
158 6.1 1 in 7.7 in 28 in 7.2 in
162 9.3 1 in 7.6 in 30 in 7.1 in
164 (arrived) 10.0 0 in 7.7 in 23 in 7.5 in
166 10.0 0 in 7.7 in 10 in 7.3 in
170–180 10.0 0 in 7.7 in 7–8 in 7.4–7.6 in

What this shows: * The ball keeps its size and shape in both modes: ~15 in across (90 % of its bees within 7.1–7.8 in of its centre). Its 5–95 % extent is 10–11 in along and across the path. It does not stretch out. * By sight: the ball goes with her as one body. The bees are pulled toward her far harder than her slow move needs, so it lags about an inch. * By scent: * At rest: she sits near the edge of the ball (7–10 in from its centre). The 1-ft air grid places the scent peak a little off her. * When she moves: her pheromone reaches the bees with a delay and their drift up its gradient is limited, so she flies out of the ball. * During the trip: the intact ball follows ~2.5 ft behind her (30 in at most). It closes to ~10 in 2 s after she stops, and to its resting 7–8 in after ~6 s. * Almost no bee is lost in either mode: about 50 are following and 30–50 milling at any time, as before the move. Fewer than 5 are within 2 ft of the old spot 6 s after she leaves. * Hashes (move at step 18000):

follow 150 s 158 s 200 s 210 s
sight 96e1ecbd 9181e82b aa725396 d3bc1040
scent 31098197 1a27e969

Verified (headless Chromium, SwiftShader, from file://)

Known limits (A2)


CT52.A1.SphereSwarm — context file

This is a browser simulation (WebGL and three.js r186, bundled locally, so it works straight from disk) of a honeybee reproductive swarm. It does not hang from anything. The queen flies with the milling cloud for a while, then holds a point in the open and hovers there. The bees that pick up her scent gather around her and keep flying in a close ball, about 15 inches across.

The user's request (CT52.A1)

This is a variation on the latest CT39.Cx.Swarm simulations. The geometry used can be the same. As with the previous version(s) there is no wind, as if it were in a courtyard or other protected environment. Instead of the queen moving off to attach itself to some horizontal geometry, after flying around in the swarm for a while, the queen should position herself in the swarm somewhere and hold a mostly static position for the first phase of this simulation. When the bees sense the scent, they should fly reasonably close to queen and continue to fly around her in a reasonably close formation to the extent they continue to sense the organizing scent. If it makes sense to have other bees use their wings to beat the sense around, that is ok, otherwise, presumably the scent is diffused in a gradient around the queen. It is hoped that the bees will begin to form a "close in" shape around the queen, while still flying. When observed in the wild, the "close in" swarm of bees was roughly spherical and perhaps 12-18 " in diameter. No initial splash page or descriptive text is necessary at this time. The initial number of bees can be about 5,000 The rest of the user interface can stay the same. The simulation will run for several minutes, total time unknown. In a later version, after several minutes, the queen will fly to a location about 10-20 feet away, in a tree, but not attached to the tree. We want to see what is involved with the close in swarm following the queen.

Background from the CT39 conversation

The user once watched a real swarm: a sphere of bees about 10 ft across that contracted to a 12–18 in ball. The ball seemed unattached and the bees did not seem to be gripping anything. In C6 this was noted as a possible "hovering ball" mode for later. CT52 is that mode.

What A1 does

The run (seed 3906, 5,000 bees; Node and Chromium give the same hashes)

t (s) milling following the scent in the ball scenting in flight ball: 90 % within (in) half within (in)
10 5,000 0 0 0 — —
30 4,944 3 53 11 8.1 3.5
60 4,206 22 772 149 6.9 3.8
90 2,290 43 2,667 526 7.5 4.5
120 353 66 4,581 925 7.7 4.9
150 42 56 4,902 988 7.6 5.0
300 26 44 4,930 992 7.6 5.0

What happens: * 0–20 s: the milling cloud, as in CT39. The queen flies among the bees, slower and calmer than the workers. * About 20–28 s: the queen flies to her station and holds it. The station is 7 ft up and 4 ft in front of the arbor's front beam, toward the camera: in the open, inside the arbor's frame from the default view. She hovers there, drifting a few inches (rms 0.08 ft). * From about 28 s: her scent spreads. The bees that smell it fly to her and join the ball. Scenting bees in the ball add their own scent, so the gathering speeds up. * By about 140 s: 98 % of the bees are in the ball. About 50 bees are on their way in or out at any time, and about 30 still mill. * The steady ball: * Size: 90 % of its bees are within 7.6–7.8 in of the queen, so it is about 15 in across. Half are within 5 in. The rms-equivalent diameter is 14.2 in. * Speed: the bees fly at about 2.1 ft/s (0.65 m/s) on average, in all directions. * The queen: she stays at its centre. * Bee count changes the size: * 1,500 bees: 90 % within ~7 in. Gathering is slower (less scent), and about half still mill at 240 s. * 15,000 bees: 90 % within 8.6–10 in, so about 17–20 in across. * Hashes: * at 10 s: e671b582; * at 60 s: 9503df3c; * at 25 s (3,000 steps): 2a31c95c, the same after seeking back from 60 s; * at 300 s: a2158f5e.

The simulation (_sim.js; STRIDE 23 unchanged)

New mode 3, "in the ball". The modes are now: * 0: milling. * 1: following the scent. * 3: flying in the ball.

Mode 2 ("settled") is never used in A1. The hanging-chain machinery (grips, loads, strands, _relax) is kept but unused.

The queen (bee 0): * Before queenSettle (20 s): she mills. * After that: a velocity controller flies her to the station. Her cruising speed is 6 ft/s, slowing as she nears it, and her acceleration is capped at 25 ft/s². * Hovering: her drift is a slow Ornstein–Uhlenbeck (OU) offset kept in her otherwise unused grip slots 18–20, so it is part of the saved state. * At the station: within 0.5 ft of it, she becomes mode 3. She emits queenEmit (1.0/s); while flying she emits queenFlyingEmit (0.35/s). * When she turns: with almost no speed she slowly turns about the vertical, so her body orientation is defined.

Following the scent (mode 1): * Becoming attracted: as in CT39, when the scent passes the bee's own threshold. * Giving up (new): a bee goes back to milling if the scent falls below loseScent (0.5) × its threshold. This is "to the extent they continue to sense the scent". * Steering: * within visRange (6 ft) of the queen it flies straight at her; * otherwise it flies up the scent gradient; * it slows as it nears her. * Joining: within ballJoin (1.6 ft) it joins the ball (mode 3). A share scentFrac (20 %) of the joiners become in-flight scenters. * Landing and the C1 under-the-beam approach rule: both are switched off.

The ball (mode 3, _ballStep): each bee carries a velocity and feels four things. 1. A pull toward the queen: ballPull 24 ft/s², plus ballPullOut 80 ft/s² per ft beyond ballEdge 0.35 ft. 2. Personal space: a push down the gradient of the local density of ball bees. * The density comes from a 40³ grid of 0.12-ft cells that follows the queen. It is rebuilt at 30 Hz, with each bee spread over its 8 nearest grid points (cloud-in-cell). * Strength: ballPress (2.2 ft²/s²) × ∇n / n0, stiffening as (n/n0)² once the density n passes n0. * n0 = 1 / (ballSpacing × worker length)³, with a spacing of 1.35 body lengths (17 mm). That is ~5,500 bees/ft³. 3. Erratic flight: OU wander, at 0.55 of the milling wander strength. 4. Speed and drag: its own slow speed (ballSpeed 1.6 ft/s × the bee's OU speed factor, 0.7–4 ft/s; response 8/s) and drag (3/s).

The size is not set anywhere. It comes from the bees' speed against the pull (a kinetic "temperature") plus personal space against crowding.

Other rules in the ball: * Leaving: a ball bee goes back to mode 1 if it is flung beyond ballLeave (5 ft), or to mode 0 if it loses the scent. * Excursions: a ball bee darts out for 1–3 s at a rate of ballExcursion 0.004 per second, then comes back. This keeps the edge alive. * In-flight scenting: each scenter emits flightScentEmit (0.015/s) where it flies. * The timber is solid for ball bees too. * The milling neighbour hash and the cloud centroid use only modes 0 and 1. The ball would otherwise make the separation loop quadratic and pull the cloud's "stay together" centre.

API: * census() returns [milling, following, in the ball incl. the queen, scenting in the ball]. * ballShape() returns {n, cx, cy, cz, diameter (rms-equivalent), queenHolding, station}. * window.CT52Sim is the sim's global.

Determinism: as in CT39, the sim uses only + − × ÷ and sqrt, a fixed step (1/120 s), and integer RNG. Checkpoints carry the whole state, so rewinding is exact.

Cost: about 0.35 s of CPU per simulated second at 5,000 bees (Node), so 1× runs comfortably in real time. At 15,000 bees it takes about 1 s per simulated second.

The renderer and UI (_main.js, index.html)

Verified (headless Chromium, SwiftShader, from file://)

Known limits / honest notes

Next (asked for in the request)

A2 or later: after several minutes, the queen flies 10–20 ft to a spot in a tree, but does not attach to it, and the ball follows her. Much of this is already in place: * the station is a parameter (stationDX/Y/Z); * she flies to it with a velocity controller; * the ball's density grid follows her.

What is needed: * a tree in the scene (the arbor scene has none); * a time for the move; * a choice of how the ball travels. A1's bees would follow her pull directly. Real swarms are steered by a few fast "streakers" (SCIENCE §9).