Available on crate feature
raster only.Expand description
mulberry32 deck RNG port + buildWorld fixture + o(C) organization degree
(topology-deck.html:120-121, 129-179, 196-208). Task 6.
mulberry32 is a fixture-only RNG that never enters the general
layout/community API (Pcg64Mcg remains the crate’s canonical
generator) — see the plan’s CRITICAL REFERENCE CORRECTION on
mulberry32 vs Pcg64Mcg.
Structs§
- Agent
- One of the 28 seeded agents (
topology-deck.html:129-134). - Community
- An organizing community: a member set plus internal cohesion links
(
topology-deck.html:135-143). - Deck
World - The instrument input bundle — everything
instruments::buildreads to render a scene.build_world(seed)(below) is the seeded deck fixture producer (topology-deck.html:151-179’sbuildWorldreturn value);raster::ingest::to_world(Phase I) is the real-graph producer for an arbitraryHypergraph. Both paths converge on this one struct so the frozen render path (instruments::build→rasterize/render_pixels) never has to know which producer built its input — this is the adapter-into-struct design (plans/phase-I-topology-ingest.mdCRITICAL DESIGN RULING), chosen over aWorldSourcetrait so the golden path is edited by neither producer, ever. - Extraction
- A multilateral extraction hyperedge: deduped periphery tails -> one
capital head (
topology-deck.html:145-149). - Mulberry32
- Byte-exact Rust port of the deck’s
mulberry32(a)closure (topology-deck.html:120-121). State is a wrappingu32;next()reproduces the JSMath.imul/>>>/|0arithmetic bit-for-bit (pure wrapping-integer arithmetic — no float-tolerance concern, user CLAUDE.md §4).
Functions§
- build_
world - Port
buildWorld(seed)(topology-deck.html:129-179): 28 agents in 3 blocs, 4 organizing communities (capital δ fully cohesive, the rest atomized with 1 link), 4 extraction hyperedges, and the 13-industry table. - deck_
hypergraph - The shared
DeckWorld -> &Hypergraphadapter (Finding 6): 28 agents become nodes keyed by their id. The single bridge fromDeckWorldto the shipped&HypergraphAPIs (subhypergraph,connected_components, Task 7’snormalized_laplacian), none of which takeDeckWorlddirectly. - do_tick
- Port of
doTick()(topology-deck.html:243-252, Task 10). Order verbatim (Finding 1): (1) wealth extraction overworld.extraction—take = mass·0.12; each tail losestake/|tails|under aMath.max(0.2, …)floor; the head gainstake·0.8; every bloc-1 (core-labor) agent gainstake·0.2/9; THEN (2) c-accumulation — each industry’sc ×= 1.035iflane>=2else×= 1.015(v,euntouched). Does not itself calltransform— callers compute readouts from the mutatedworld.industriesafterward (the crate’stransformis a pure fn with noIndustry-side effects to “re-run”, unlike the deck’s closure-capturedW.industries). Bounded:world.extraction.len() * (max tails + agents.len()) + world.industries.len(). - global_
pi0 - Global Π₀: union all community links and all extraction tails→head over
the full 28-agent population (
topology-deck.html:196-204’sglobalPi0), hand-rolled (notalgorithms::connected_components, which walks a&Hypergraph—DeckWorld’s extraction hyperedges are directed tails→head, not the crate’s undirected membership shape). - org_
degree - Organization degree
o(C) = 1if|C|<2else1 - (|Π₀(C)|-1)/(|C|-1)(topology-deck.html:206-208). Built as an isolated per-community graph (own members as nodes, own links as edges) rather than a slice of the shareddeck_hypergraph: the deck’sorgOfwalks onlyc.links, and the periphery communities draw from an overlapping pool (cell α/cell βboth shuffle the full 14-agent bloc), so filtering a shared multi- community graph by node membership alone (subhypergraph) could admit another community’s edge whose endpoints happen to fall inside this community’s member set — this isolated construction is immune to that and reproducesorgOfexactly. Reusesconnected_components(algorithms::connected) for|Π₀(C)|, per Task 6. - periphery_
mean_ wealth - Mean wealth of the bloc-2 (periphery) agents, in
agentsorder (topology-deck.html:439-440’spw). Pure arithmetic — byte-exact. - psa
psa = sigmoid(pw − per[0].subsistence)(topology-deck.html:443) — the periphery’s assimilation survival probability. Tolerance-bounded golden (routes throughsigmoid’sexp, Finding 3), NOT byte-exact.- psr
psr = min(1, (org(cell α)+org(cell β))/2 / (repression/2.6·0.9))(topology-deck.html:444) — the deck’s calibrated rupture-survival form; diverges from the textbookP(S|R)=Org/Repression(see OPEN DECISION D-R7). Pure division — byte-exact.communities[0]/[1]arecell α/cell βbybuild_world’s push order.- sigmoid
sigmoid(x) = 1/(1+e^-x)(topology-deck.html:122). Routes throughexp— not byte-exact across libm implementations (Finding 3, user CLAUDE.md §4); callers golden-test it tolerance-bounded (< 1e-12).