Repository navigation
Conversation
…imulator AI-assisted: Claude Opus 5.5
…dapter AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
… PDRs AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
marilib.sim, a slot-level model of one mari gateway and its nodes. It sits behind marilib's gateway adapter, soMarilibEdge, themari-edgeTUI and anything built on them (the PyDotBot controller and simulator) run against it unchanged. The goal is to answer scaling questions (how many nodes, what loss, what load) without a bench, while staying faithful to the firmware rather than to a hand-written idea of it.Approach
firmware/mari/at load time. When marilib is installed without the repo, it falls back tofirmware_snapshot.json, whichpython -m marilib.sim.snapshotwrites and the test suite checks against the sources. The simulator carries no hand-copied protocol constant.mac.c. Onestepis one slot, processed in the ordernew_slot_syncedruns it: timeouts first, then the cell's radio activity. It covers beacons, joins, keep-alives, disconnects and handovers. The node queue reproduces the firmware's 32-entry ring buffer, including its empty/full ambiguity (32 adds without a pop reads as empty), so loss from that bug shows up in the sim the same way it does on hardware.[network]defaults plus per-robot overrides). A distance channel was tried first and then dropped: it let the node count leak into the PDR, which reproduces a selection bias rather than the radio.NodeApp). The defaultSyntheticAppsends the 03app_node status packet and answers metrics probes. A host application such as the PyDotBot simulator can supply its own uplinks under its ownnext_proto.mari-simCLI. It runs a network live under themari-edgeTUI or as fast as it goes. It takes scripted events (nodes added, removed or moved, the gateway halted or reset) and load storms, and logs runs in the same format as the bench.mari-sim verifyprints formation time, RTT and PDR beside the hardware reference campaign. It asserts nothing, because the hardware reference is one campaign and the comparison is for a person to read.examples/mari_edge_stats.pyintomarilib.metrics, so the simulator and the bench share one implementation. The example now calls it.Validation
tests/sim, covering the firmware parsing and snapshot drift, MAC behaviour, wire format, link models, invariants and the CLI.firmware_snapshot.json, written bymarilib.sim.snapshotexamples/(-118 there)