How the site runs and ships
The original core, compiled
Every simulation on this site runs the protocol's own C++ routing code, the same
core/ the ns-3 benchmarks run, compiled to WebAssembly from the protocol's repository at a pinned
commit. Nothing is rewritten in JavaScript and nothing is vendored. This page shows how that code is compiled,
proven identical, packaged and deployed.
The simulation is the real core
AntHocNet's routing logic lives once, in core/: simulator-agnostic C++14 that takes time,
randomness, neighbours and timers through ports and returns decisions. The browser build compiles exactly these
core sources, unmodified, at the commit this site pins (6c8a3452c263):
core/src/pheromone_table.cppcore/src/pheromone_engine.cppcore/src/ant_history.cppcore/src/ant_message_codec.cppcore/src/ant_router_logic.cppcore/src/link_metric_registry.cpp
Around them, the browser adapter (site/anthocnet/src/: the world, mobility and radio in
sim.cpp, the scenarios, and the Embind binding in bindings.cpp) only moves packets and
carries out the core's decisions. The JavaScript draws what the WebAssembly module reports; it holds no routing
logic (AntHocNet ADR-0021).
Proof: byte-identical to the native build
"The same code" is checked, not claimed. The same sources are built twice, natively and to
WebAssembly, and both builds of the trace runner replay every built-in scenario. Every ant and data
transmission, reception, route change, queue and drop is written with its simulated time; the two traces must
match byte for byte, and so must the scenario features' link-rule checks. It runs on every pull request here and on every core/ pull request in
AntHocNet, whose CI fetches this adapter.
Package and deploy
One script builds the site, locally and in CI (tools/build-site.sh); one workflow
gates and ships it (.github/workflows/pages.yml). A newer core reaches the site only through a
protocols.lock bump pull request, which runs every step before anything is published.
| Step and where | What happens | Run it |
|---|---|---|
1. Pinprotocols.lock | One line per protocol: repository, 40-character commit, tag. It changes only by pull request, and that PR runs every gate below. | python3 tools/lock.py AntHocNet commit |
2. Fetch.github/workflows/pages.yml | actions/checkout checks the protocol out at the pinned commit (locally, tools/build-site.sh fetches it). Its core/, docs/, api/ and toolchain pins come from there. | tools/build-site.sh build/site |
3. Overlaytools/build-site.sh | site/anthocnet/ (the browser adapter, the game and the site shell) is laid over the checkout as its web/. Nothing of the protocol is copied into this repository. | — |
4. Compilesite/anthocnet/CMakeLists.txt | Emscripten (emsdk 4.0.10, the protocol's own pin) compiles the core's C++ sources and the adapter into anthocnet.wasm plus its ES-module loader anthocnet.js, as C++14, Release, -ffp-contract=off. | emcmake cmake -S web -B web/build-wasm && cmake --build web/build-wasm --target anthocnet |
5. Assemblesite/anthocnet/build-pages.sh | The game with the module (cache-busted by the module's sha256), the protocol's mkdocs docs at docs/, its Doxygen API at api/, all under one top bar, plus the old-URL redirects. Then tools/render_hub.py writes the hub, every project space and this page. | web/build-pages.sh |
6. Provesite/anthocnet/test/parity.sh | The same sources are built natively and to WebAssembly; both run every built-in scenario for seeds 1, 2, 7 and 42 over 120 simulated seconds, and the decision traces must be byte-identical. | web/test/parity.sh 120 "1 2 7 42" |
7. Check.github/workflows/pages.yml | The protocol's web tests (quests, translations, Nest coverage, tuning bench, campaign levels, labs), both crawls (every link, asset and anchor), and both browser smokes with axe, in day and night. | node site/anthocnet/test/smoke.mjs …; node test/hub-smoke.mjs … |
8. Deployactions/deploy-pages | Only main deploys: the assembled tree is uploaded as the Pages artifact and published. Pull requests run every step above and stop here. | — |
9. Verifysite/anthocnet/test/live-smoke.mjs | After the deploy, the live site must serve the module this build made (its hash in engine.js), the game must deliver packets, the docs, API and 404 must carry the top bar, and the hub and every project space must answer 200. A failure opens a tracking issue. | — |
The full write-up, with the local commands and the toolchain pins, is docs/pipeline.md; the decision behind it is ADR-0001.