feat(08-02): ARG2 codec — one version, one decode path (G-suite GREEN)
graph.ts versioned IN PLACE (no second codec): GRAPH_MAGIC 0x41524732, GRAPH_VERSION 2, HEADER_SIZE 72 (72%8==0 keeps f64 views aligned); header gains landmarkCount u32 @60 (the old pad), landmarkQuantumS f32 @64, reserved u32 @68; the landmark suffix (u16 toTable, u16 fromTable, u32 landmarkNodes) extends layoutFor's total arithmetic — exact-size law covers the variable suffix BEFORE any view allocation (T-08-01). D-01 fail-honest: ARG1 bytes / version!=2 / landmarkCount=0 / hostile quantum / size mismatch all decode null (committed mini-graph-arg1.bin is the standing rejection vector). GraphInput.landmarks REQUIRED and loud-validated (T-08-04). RoadGraph gains the five landmark fields (Plan 08-03's ALT potentials consume them). Fixture regenerated as ARG2 through the SAME encode authority: the builder gains the tiny real landmark stage (L=2, anchors [0,18], quantum 0.1s, coverage 1.0 — identical bytes every re-run). Rule-3 call-site updates forced by the required-landmarks law (missed by the plan's files list): astar.test A3 + snap.test S3 synthetics carry inert hand landmark blocks. Fixture regen pulled forward from task 3 so this commit's own battery is green (74 passed, 0 failed).
This commit is contained in:
@@ -110,12 +110,20 @@ test("S3 nameId — a perimeter fix resolves 'Jalan Persiaran Mini'; an unnamed
|
||||
assert.equal(g.nameAt(atNode1.nameId), "Jalan Persiaran Mini");
|
||||
|
||||
// Synthetic 2-node graph with ONE unnamed edge -> nameId null.
|
||||
// ARG2 (plan 08-02): the landmark block is required by the one encode
|
||||
// authority; values are inert steering data until ALT lands (08-03).
|
||||
const bare = encodeGraph({
|
||||
lat: [3.15, 3.1505],
|
||||
lng: [101.69, 101.6905],
|
||||
edges: [{ from: 0, to: 1, seconds: 4 }],
|
||||
names: [],
|
||||
maxSpeedKmh: 60,
|
||||
landmarks: {
|
||||
quantumS: 0.5,
|
||||
nodes: [0],
|
||||
to: Uint16Array.of(0, 30),
|
||||
from: Uint16Array.of(0, 30),
|
||||
},
|
||||
});
|
||||
const { decodeGraph, UNNAMED_NAME_ID } = await loadGraph();
|
||||
const bg = decodeGraph(bare);
|
||||
|
||||
Reference in New Issue
Block a user