Skip to content

lanes: an input clock is cut no further than the cap, ticks taken in turns; the host's plane textures kept - #18

Merged
imbcmdth merged 7 commits into
mainfrom
lanes-and-planes
Oct 19, 2026
Merged

imbcmdth merged 7 commits into
mainfrom
lanes-and-planes

Conversation

@imbcmdth

Copy link
Copy Markdown
Owner

The scheduler let an input clock's cut queue every settled tick at once: a node clocked by sound with a window of one sample (foundmeat's listener on the programme's sound) was cut 1024 ticks by every packet, 48,000 a second, and every dispatch and completion woke every worker. Measured on foundmeat's box (perf, strace, gdb): 1.34 cores for an idle broadcast on 0.32.1, 61% of it the kernel, each worker making about 30,000 context switches a second; the 1023-task queue in their traces was the same lane.

  • lanes: an input clock's cut stops at the cap and holds the next settled tick back, the lane counting as full while it does; a lane that runs one tick at a time takes the ticks queued behind the one it starts, up to 1024, in one turn, and a turn's progress marks leave once; the reader of an audio clock with ticks held back waits on the packets behind it, not the ticks. The a6a649c memory bound stays and gets the test it lacked. Unit tests for the cap, the turns, the self-clocked bound, and a node finishing or failing mid-turn; a live test that a node clocked a sample a tick keeps the programme in real time.
  • gpu: the plane textures the host makes for conversions and uploads are kept and reused, up to four free per size and format.
  • The plan records where the CPU went and that the two device-side copy commits of fix/linux-route-cpu stay unmerged (within noise, and resting on an undocumented wgpu-core lock).

On the box: idle broadcast 1.34 → 0.99 cores with the lane change, 0.92 with the planes kept (the Windows figure); with a 1080p60 feed 1.51 → 0.95; real time held in every run; the two-loop node_shapes stress 0 of 50 hung on the combined head (the earlier hangs were the start-up waker, fixed in 0.32.2).

🤖 Generated with Claude Code

imbcmdth and others added 7 commits October 19, 2026 13:28
… runs a tick at a time takes its ticks in turns

An audio clock ticks every `window` samples, so foundmeat's listen_audio,
with a window of one sample, was cut 1024 ticks by every packet of 1024
samples and queued them all at once: the 1023 tasks against a cap of 10
in their trace. Every tick cost a turn of the scheduler and a wake of
every waiting thread, about 48 us of CPU, so the lane needed 2.3 cores to
keep up with 48000 ticks a second and fell behind when the box was busy.
Its reader carries the programme's own sound, so the programme slowed with
it.

The cut now stops at the cap and holds the next settled tick back, the
lane counts as full to its readers while it does, and the rest is cut as
the queue drains. A lane that runs one tick at a time takes the ticks
queued behind the one it starts, and those its clock settled past the cap,
up to 1024, in one turn. The progress marks of a turn leave once, and a
lane with a tick held back is picked first. listen_audio alone now runs
at 4.0 times real time with 0.32 cores of CPU, where it ran at 0.84
times with 3.7 cores.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e packets behind it, not the ticks

A packet of 1024 samples settles 1024 ticks of a clock cut a sample a
tick, so a lane holding ticks back did so after every packet, and the
reader that carries the programme's sound beside its copy waited every
21 ms for the lane to be handed the rest. While ticks are held back, the
packets waiting on such a clock count against the cap, and its reader
waits once the lane is that many packets behind.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…tener on a clock cut a sample a tick

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The ticks of the turn after the one it finished on are skipped, as a
lane that stops drops its queue, a last tick queued behind them goes
with them, and the last call is made by the instance that finished.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… shipped in 0.32.1

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e same size and format

Every conversion on the device and every upload made new textures and
dropped them with the frame, an allocation and a free in the driver at each
frame. The textures the host makes are now kept, up to four free of each
size and format, and handed to the next plane; a module's texture a frame
owns is dropped as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit f3c5b0e)
…es left unmerged

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@imbcmdth
imbcmdth merged commit 1a44539 into main Oct 19, 2026
1 check passed
@imbcmdth
imbcmdth deleted the lanes-and-planes branch October 19, 2026 21:11
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