Skip to content

nav_swarm: without a worker, the frame steps the navigator at its own tick - #1530

Merged
transfix merged 1 commit into
masterfrom
fix/swarm-frame-thread-step
Nov 25, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/swarm-frame-thread-step

Conversation

@transfix

Copy link
Copy Markdown
Owner

In a browser without threads (GitHub Pages' arigl, which isn't
cross-origin isolated), nav_city_drive's swarm ran seven times too fast. Its
console said "nav_swarm: ... ticks_per_step: the step is not a whole number
of clock quanta".

Without a worker the swarm followed the clock with the training scene's step
(ts.dt, 0.06 s), which is 7.2 of the suite's 1/120 s quanta, so the clock
refused it. The follower kept its default period of one quantum, and each of
those took a whole navigator step of 7. The world it steps has the hosts'
tick (config_for: kSimTick, 7 quanta), and a sim_thread follows that. The
frame's thread now does too. A threaded build (natively, cyberpcangel.com's
isolated pages) was never affected.

swarm_spec::worker (C++ only, not a prop; true by default) lets a host or a
test step the navigator on the frame's thread where there are threads.
Natively that path was unreachable, which is how this went unseen.

Test AriadneSceneSwarm.StepsOnTheFramesThreadWithoutAWorker: 70 quanta are
10 navigator steps, and the agents move. With the old step it failed with 70
steps and the browser's message. It passed 20 repeats, and the scene swarm
and cvcgl_ariadne_swarm suites pass.

… tick

In a browser without threads (GitHub Pages' arigl, which isn't
cross-origin isolated), nav_city_drive's swarm ran seven times too fast. Its
console said "nav_swarm: ... ticks_per_step: the step is not a whole number
of clock quanta".

Without a worker the swarm followed the clock with the training scene's step
(ts.dt, 0.06 s), which is 7.2 of the suite's 1/120 s quanta, so the clock
refused it. The follower kept its default period of one quantum, and each of
those took a whole navigator step of 7. The world it steps has the hosts'
tick (config_for: kSimTick, 7 quanta), and a sim_thread follows that. The
frame's thread now does too. A threaded build (natively, cyberpcangel.com's
isolated pages) was never affected.

swarm_spec::worker (C++ only, not a prop; true by default) lets a host or a
test step the navigator on the frame's thread where there are threads.
Natively that path was unreachable, which is how this went unseen.

Test AriadneSceneSwarm.StepsOnTheFramesThreadWithoutAWorker: 70 quanta are
10 navigator steps, and the agents move. With the old step it failed with 70
steps and the browser's message. It passed 20 repeats, and the scene swarm
and cvcgl_ariadne_swarm suites pass.
@transfix
transfix enabled auto-merge (squash) November 25, 2026 01:55
@transfix
transfix merged commit 9df268c into master Nov 25, 2026
30 checks passed
@transfix
transfix deleted the fix/swarm-frame-thread-step branch November 25, 2026 02:03
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