Skip to content

sim: the speed control reaches the engine - #755

Open
A13xB0 wants to merge 1 commit into
mainfrom
faster-steps-the-engine
Open

A13xB0 wants to merge 1 commit into
mainfrom
faster-steps-the-engine

Conversation

@A13xB0

@A13xB0 A13xB0 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

The transport's slower and faster buttons and sim.speed never changed how fast a session ran. The engine steps in its own fixed 10 ms; each store tick took exactly one step whatever step_ms said, then set the clock back from the engine. The label changed and nothing else, and every run in a session went at real time with the processor mostly idle. sim.faster's description also said it "trades detail", which it never did.

A tick is now owed its step_ms and pays it in whole engine steps, checking due sends after each step so a scheduled send still fires at its instant, and stopping at the end of a timed run so sim.run lands where it was asked. Below 10 ms a tick steps only once it is owed a whole step, so 5 is half speed. Native firmware reads the simulator's clock, so nothing in it notices; the engine's step is unchanged, so no result changes, only how long it takes.

Measured on a 241-node native mesh: 0.96x real time before at any setting, about 3x at 1000 ms/tick after. The captures are the 58-node Fife fixture: 1.00x before, 14.15x after.

In the GUI: the transport's slower and faster buttons, and the realtime figure in the status bar.

Before: 1000 ms/tick, 1.00x realtime After: 1000 ms/tick, 14.15x realtime
before after

Tests: a tick covers its size; a timed run ends where asked even inside a large tick, and the next tick does not inherit what was owed; a 5 ms tick steps every other time.

Docs: MeshBench/docs#46

The engine steps in its own 10 ms, and a tick took exactly one step
whatever step_ms said, then set the clock back from the engine. The
transport's slower and faster buttons and sim.speed changed the label
and nothing else, and every session run went at real time with the
processor mostly idle. A tick is now owed its step_ms and pays it in
whole engine steps, checking due sends after each, and stops at the end
of a timed run.

This branch has not been deployed

No deployments
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.

2 participants