From 3f5efdf70f2b4012d3dcb30566959fded29d1712 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 18:44:15 -0400 Subject: [PATCH] Kernel rig: one results check, each {step, pointer?, json, rel?, abs_mm?} Two branches added a results field in different forms ({step, json} and {command, pointer, value}). The grader keeps one: a 1-based step, an optional JSON pointer into its answer, and the value matched as files are, with an optional relative or absolute tolerance. The construction and inspect cases are rewritten to it. Co-Authored-By: Claude Opus 5.5 --- tests/kernel-cases/README.md | 3 +- .../expected.json | 16 ++++----- .../cov-center-of-mass-box/expected.json | 8 ++--- .../expected.json | 24 ++++++------- .../expected.json | 8 ++--- .../expected.json | 8 ++--- .../cov-compare-identical-boxes/expected.json | 12 +++---- .../cov-compare-taller-box/expected.json | 36 +++++++++---------- .../expected.json | 20 +++++------ .../expected.json | 28 +++++++-------- .../expected.json | 16 ++++----- .../expected.json | 8 ++--- .../expected.json | 12 +++---- .../expected.json | 8 ++--- .../expected.json | 24 ++++++------- .../cov-isocurve-cube-top/expected.json | 16 ++++----- .../expected.json | 4 +-- .../expected.json | 4 +-- .../expected.json | 4 +-- .../expected.json | 4 +-- 20 files changed, 131 insertions(+), 132 deletions(-) diff --git a/tests/kernel-cases/README.md b/tests/kernel-cases/README.md index 1c2209c6c..9421d09f1 100644 --- a/tests/kernel-cases/README.md +++ b/tests/kernel-cases/README.md @@ -110,9 +110,8 @@ the frozen truck-geometry PRs, a `kernel-paused` PR), for the report's coverage | `timeout_s` | A longer timeout for this case than the run's (at most 1800 s), for cases that are slow by nature. A case that only needs it on a loaded machine shouldn't set it. | | `tolerance` | Optional overrides: `rel`, `abs_mm`, `mesh_mm`, `weld_mm`. | | `files` | The files the case wrote to `$OUT`, each `{path, json \| csv \| dxf}`, matched as a part of what is there: every key the case gives, an array item by item and as long, a whole number exactly, any other number within `rel`. `json`: the file's JSON; `csv`: its rows, as objects keyed by the header row; `dxf`: per layer of its ENTITIES section, how many of each entity (`{"CUT": {"CIRCLE": 1, "ELLIPSE": 0, "length_mm": 31.416}}`; a count may be a range `[min, max]`) and `length_mm`, the total length of its lines, arcs, circles, ellipses and polylines. | -| `results` | The commands' own answers, each `{step, json}`: the answer of the `step`th command (from 1) matched as `files` matches JSON (a flat pattern's bends, a rule's values). | +| `results` | The commands' own answers, each `{step, pointer?, json, rel?, abs_mm?}`: the answer of the `step`th command (from 1, base commands included), or its part at the JSON `pointer` (RFC 6901), matched as `files` matches JSON: a whole number exactly (a count), another within `rel` (the case's relative tolerance unless given) or `abs_mm`, lists item by item. | | `construction` | `{name: spec}`, a spec being `{point: [x,y,z]}`, `{axis: {through, dir}}` or `{plane: {through, normal}}`: each named construction point, axis or plane as the timeline evaluated it. A point within the position tolerance (`tolerance.abs_mm`, else 1e-3 of the box diagonal, of 1 mm where there is no body); an axis whose direction is parallel to `dir` (either way, sine of the angle at most 1e-6) and whose line passes within it of `through`; a plane likewise with `normal`. An axis or plane is graded as the line or plane it is, not by the origin it keeps. | -| `results` | `[{command, pointer, value, rel?, abs_mm?}]`: values in the commands' own replies (an inspect command's numbers). The reply of the script's `command`-th command (from 0, base commands included), at the JSON `pointer`, is `value`: a number within the relative tolerance, `[x, y, z]` within the position tolerance, anything else (a string, a bool, null, a list) equal. | | `missing` | A capability SolidCraft has no command or parameter for yet (`"solid.thread has no start count"`): the case is reported **not supported yet** without running, so the gap stays visible. | ## The kernel rig gate diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/expected.json b/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/expected.json index ba0e92e09..c20f419e4 100644 --- a/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/expected.json +++ b/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/expected.json @@ -5,32 +5,32 @@ "method": "box 40 x 30 x 20 with a corner at the origin (V 24000 at (20,15,10)) and a cylinder r 5, h 10 on (60,0,0) (V 250 pi = 785.40 at (60,0,5)): the volume-weighted mean (21.2675, 14.5247, 9.8416), V = 24000 + 250 pi", "results": [ { - "command": 2, + "step": 3, "pointer": "/center", - "value": [ + "json": [ 21.267517524987444, 14.524680928129708, 9.84156030937657 ] }, { - "command": 2, + "step": 3, "pointer": "/volume", - "value": 24785.398163397447 + "json": 24785.398163397447 }, { - "command": 2, + "step": 3, "pointer": "/bodies/1/center", - "value": [ + "json": [ 60, 0, 5 ] }, { - "command": 2, + "step": 3, "pointer": "/bodies/1/volume", - "value": 785.3981633974482 + "json": 785.3981633974482 } ] } diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-box/expected.json b/tests/kernel-cases/inspect/cov-center-of-mass-box/expected.json index a40b16dd7..b6d028993 100644 --- a/tests/kernel-cases/inspect/cov-center-of-mass-box/expected.json +++ b/tests/kernel-cases/inspect/cov-center-of-mass-box/expected.json @@ -5,18 +5,18 @@ "method": "box 40 x 30 x 20 with a corner at the origin: the middle (20,15,10), V = 40 x 30 x 20 = 24000", "results": [ { - "command": 1, + "step": 2, "pointer": "/center", - "value": [ + "json": [ 20, 15, 10 ] }, { - "command": 1, + "step": 2, "pointer": "/volume", - "value": 24000.0 + "json": 24000.0 } ] } diff --git a/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json b/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json index af414d55b..108cd41fb 100644 --- a/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json +++ b/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json @@ -5,38 +5,38 @@ "method": "spheres r 5 on (0,0,0) and (20,0,0): 20 - 5 - 5 = 10 apart, from (5,0,0) to (15,0,0)", "results": [ { - "command": 2, + "step": 3, "pointer": "/overlaps", - "value": [] + "json": [] }, { - "command": 2, + "step": 3, "pointer": "/near/0/a", - "value": "A" + "json": "A" }, { - "command": 2, + "step": 3, "pointer": "/near/0/b", - "value": "B" + "json": "B" }, { - "command": 2, + "step": 3, "pointer": "/near/0/distance_mm", - "value": 10.0 + "json": 10.0 }, { - "command": 2, + "step": 3, "pointer": "/near/0/from", - "value": [ + "json": [ 5, 0, 0 ] }, { - "command": 2, + "step": 3, "pointer": "/near/0/to", - "value": [ + "json": [ 15, 0, 0 diff --git a/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json b/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json index 07c05664d..16f8a2a5e 100644 --- a/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json +++ b/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json @@ -5,14 +5,14 @@ "method": "spheres r 5 on (0,0,0) and (8,0,0): the lens pi (4r + d)(2r - d)^2 / 12 = pi 28 4 / 12 = 29.3215, centred on (4,0,0)", "results": [ { - "command": 2, + "step": 3, "pointer": "/overlaps/0/volume_mm3", - "value": 29.321531433504735 + "json": 29.321531433504735 }, { - "command": 2, + "step": 3, "pointer": "/overlaps/0/center", - "value": [ + "json": [ 4, 0, 0 diff --git a/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json b/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json index 8f4b8e3af..71e960ac5 100644 --- a/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json +++ b/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json @@ -5,14 +5,14 @@ "method": "spheres r 5 on (0,0,0) and (20,0,0) are 10 apart; closer than 5 asked: none", "results": [ { - "command": 2, + "step": 3, "pointer": "/overlaps", - "value": [] + "json": [] }, { - "command": 2, + "step": 3, "pointer": "/near", - "value": [] + "json": [] } ] } diff --git a/tests/kernel-cases/inspect/cov-compare-identical-boxes/expected.json b/tests/kernel-cases/inspect/cov-compare-identical-boxes/expected.json index e1d52a15b..39a7ac301 100644 --- a/tests/kernel-cases/inspect/cov-compare-identical-boxes/expected.json +++ b/tests/kernel-cases/inspect/cov-compare-identical-boxes/expected.json @@ -5,19 +5,19 @@ "method": "boxes 40 x 30 x 20 on the same corner: identical, no region, B - A = 0", "results": [ { - "command": 2, + "step": 3, "pointer": "/identical", - "value": true + "json": true }, { - "command": 2, + "step": 3, "pointer": "/regions", - "value": [] + "json": [] }, { - "command": 2, + "step": 3, "pointer": "/difference/volume_mm3", - "value": 0.0 + "json": 0.0 } ] } diff --git a/tests/kernel-cases/inspect/cov-compare-taller-box/expected.json b/tests/kernel-cases/inspect/cov-compare-taller-box/expected.json index fb9f6b54a..016be182f 100644 --- a/tests/kernel-cases/inspect/cov-compare-taller-box/expected.json +++ b/tests/kernel-cases/inspect/cov-compare-taller-box/expected.json @@ -5,49 +5,49 @@ "method": "box A 40 x 30 x 20 and B 40 x 30 x 25 on the same corner: B - A is the slab z 20..25, V 6000, only in B, at most 5 from A", "results": [ { - "command": 2, + "step": 3, "pointer": "/a/volume_mm3", - "value": 24000.0 + "json": 24000.0 }, { - "command": 2, + "step": 3, "pointer": "/b/volume_mm3", - "value": 30000.0 + "json": 30000.0 }, { - "command": 2, + "step": 3, "pointer": "/difference/volume_mm3", - "value": 6000.0 + "json": 6000.0 }, { - "command": 2, + "step": 3, "pointer": "/identical", - "value": false + "json": false }, { - "command": 2, + "step": 3, "pointer": "/regions/0/side", - "value": "only_in_b" + "json": "only_in_b" }, { - "command": 2, + "step": 3, "pointer": "/regions/0/volume_mm3", - "value": 6000.0 + "json": 6000.0 }, { - "command": 2, + "step": 3, "pointer": "/only_in_b/volume_mm3", - "value": 6000.0 + "json": 6000.0 }, { - "command": 2, + "step": 3, "pointer": "/only_in_a/volume_mm3", - "value": 0.0 + "json": 0.0 }, { - "command": 2, + "step": 3, "pointer": "/deviation/max_mm", - "value": 5.0 + "json": 5.0 } ] } diff --git a/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/expected.json b/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/expected.json index 1468968e9..4b9ac2aa8 100644 --- a/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/expected.json +++ b/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/expected.json @@ -5,29 +5,29 @@ "method": "box 40 x 30 x 20 with a corner at the origin: the faces y = 0 and z = 0 meet at 90 deg along their edge: g0, sharp, normal angle 90", "results": [ { - "command": 1, + "step": 2, "pointer": "/summary/edges", - "value": 1 + "json": 1 }, { - "command": 1, + "step": 2, "pointer": "/bodies/0/edges/0/order", - "value": "g0" + "json": "g0" }, { - "command": 1, + "step": 2, "pointer": "/bodies/0/edges/0/verdict", - "value": "sharp" + "json": "sharp" }, { - "command": 1, + "step": 2, "pointer": "/bodies/0/edges/0/normal_angle_deg/value", - "value": 90.0 + "json": 90.0 }, { - "command": 1, + "step": 2, "pointer": "/bodies/0/edges/0/gap_mm/value", - "value": 0.0, + "json": 0.0, "rel": 1e-06 } ] diff --git a/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/expected.json b/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/expected.json index 9a93b77dc..a0a667f5f 100644 --- a/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/expected.json +++ b/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/expected.json @@ -5,39 +5,39 @@ "method": "box 40 x 30 x 20 with a corner at the origin, its top-front edge (y 0, z 20) rounded r 3: the round meets the top (at y 3) and the front (at z 17) tangent, curvature jumping 0 to 1/3: g1, jump 1/3 per mm", "results": [ { - "command": 2, + "step": 3, "pointer": "/summary/edges", - "value": 2 + "json": 2 }, { - "command": 2, + "step": 3, "pointer": "/bodies/0/edges/0/order", - "value": "g1" + "json": "g1" }, { - "command": 2, + "step": 3, "pointer": "/bodies/0/edges/1/order", - "value": "g1" + "json": "g1" }, { - "command": 2, + "step": 3, "pointer": "/bodies/0/edges/0/curvature_jump_per_mm/value", - "value": 0.3333333333333333 + "json": 0.3333333333333333 }, { - "command": 2, + "step": 3, "pointer": "/bodies/0/edges/1/curvature_jump_per_mm/value", - "value": 0.3333333333333333 + "json": 0.3333333333333333 }, { - "command": 2, + "step": 3, "pointer": "/bodies/0/edges/0/verdict", - "value": "curvature_jump" + "json": "curvature_jump" }, { - "command": 2, + "step": 3, "pointer": "/bodies/0/edges/1/verdict", - "value": "curvature_jump" + "json": "curvature_jump" } ] } diff --git a/tests/kernel-cases/inspect/cov-curvature-comb-circle-and-line/expected.json b/tests/kernel-cases/inspect/cov-curvature-comb-circle-and-line/expected.json index 285efa83e..e41a902e2 100644 --- a/tests/kernel-cases/inspect/cov-curvature-comb-circle-and-line/expected.json +++ b/tests/kernel-cases/inspect/cov-curvature-comb-circle-and-line/expected.json @@ -5,24 +5,24 @@ "method": "circle r 7: curvature 1/7 everywhere, radius 7; a line: straight, no radius", "results": [ { - "command": 4, + "step": 5, "pointer": "/combs/0/min_radius", - "value": 7.0 + "json": 7.0 }, { - "command": 4, + "step": 5, "pointer": "/combs/0/max_curvature", - "value": 0.14285714285714285 + "json": 0.14285714285714285 }, { - "command": 4, + "step": 5, "pointer": "/combs/1/min_radius", - "value": null + "json": null }, { - "command": 4, + "step": 5, "pointer": "/combs/1/max_curvature", - "value": 0.0 + "json": 0.0 } ] } diff --git a/tests/kernel-cases/inspect/cov-curvature-comb-cylinder-edge/expected.json b/tests/kernel-cases/inspect/cov-curvature-comb-cylinder-edge/expected.json index 2af9c42d8..ed69c9e01 100644 --- a/tests/kernel-cases/inspect/cov-curvature-comb-cylinder-edge/expected.json +++ b/tests/kernel-cases/inspect/cov-curvature-comb-cylinder-edge/expected.json @@ -5,14 +5,14 @@ "method": "a cylinder r 5 on (60,0,0): its top edge is a circle of r 5, curvature 1/5", "results": [ { - "command": 1, + "step": 2, "pointer": "/combs/0/min_radius", - "value": 5.0 + "json": 5.0 }, { - "command": 1, + "step": 2, "pointer": "/combs/0/max_curvature", - "value": 0.2 + "json": 0.2 } ] } diff --git a/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.json b/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.json index c56e1ed3e..3c1afa071 100644 --- a/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.json +++ b/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.json @@ -5,19 +5,19 @@ "method": "box 40 x 30 x 20 with a corner at the origin and a box 10 x 10 x 10 from (5,5,5) inside it: the overlap is the small box: V 1000, centre (10,10,10)", "results": [ { - "command": 2, + "step": 3, "pointer": "/count", - "value": 1 + "json": 1 }, { - "command": 2, + "step": 3, "pointer": "/interferences/0/volume_mm3", - "value": 1000.0 + "json": 1000.0 }, { - "command": 2, + "step": 3, "pointer": "/interferences/0/center", - "value": [ + "json": [ 10, 10, 10 diff --git a/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.json b/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.json index 07812ac63..abe4ac5ea 100644 --- a/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.json +++ b/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.json @@ -5,14 +5,14 @@ "method": "box 40 x 30 x 20 with a corner at the origin and a box 40 x 30 x 20 from (40,0,0): they share the face x = 40 and no volume: no interference", "results": [ { - "command": 2, + "step": 3, "pointer": "/count", - "value": 0 + "json": 0 }, { - "command": 2, + "step": 3, "pointer": "/interferences", - "value": [] + "json": [] } ] } diff --git a/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.json b/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.json index f76118d01..1feba5a2b 100644 --- a/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.json +++ b/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.json @@ -5,42 +5,42 @@ "method": "box 40 x 30 x 20 with a corner at the origin and a box 40 x 30 x 20 from (30,20,10): they share the cube x 30..40, y 20..30, z 10..20: V 1000, A 600, centre (35,25,15)", "results": [ { - "command": 2, + "step": 3, "pointer": "/count", - "value": 1 + "json": 1 }, { - "command": 2, + "step": 3, "pointer": "/interferences/0/volume_mm3", - "value": 1000.0 + "json": 1000.0 }, { - "command": 2, + "step": 3, "pointer": "/interferences/0/area_mm2", - "value": 600.0 + "json": 600.0 }, { - "command": 2, + "step": 3, "pointer": "/interferences/0/center", - "value": [ + "json": [ 35, 25, 15 ] }, { - "command": 2, + "step": 3, "pointer": "/interferences/0/bbox/min", - "value": [ + "json": [ 30, 20, 10 ] }, { - "command": 2, + "step": 3, "pointer": "/interferences/0/bbox/max", - "value": [ + "json": [ 40, 30, 20 diff --git a/tests/kernel-cases/inspect/cov-isocurve-cube-top/expected.json b/tests/kernel-cases/inspect/cov-isocurve-cube-top/expected.json index 04b6119aa..46ccc59d7 100644 --- a/tests/kernel-cases/inspect/cov-isocurve-cube-top/expected.json +++ b/tests/kernel-cases/inspect/cov-isocurve-cube-top/expected.json @@ -5,24 +5,24 @@ "method": "cube 40 with a corner at the origin: its top is the plane z = 40, 0..40 each way; 3 curves each way, evenly spaced, are x = 10, 20, 30 and y = 10, 20, 30: 3 u-curves and 3 v-curves", "results": [ { - "command": 1, + "step": 2, "pointer": "/faces/0/body", - "value": "Cube" + "json": "Cube" }, { - "command": 1, + "step": 2, "pointer": "/faces/0/count", - "value": 3 + "json": 3 }, { - "command": 1, + "step": 2, "pointer": "/faces/0/u_curves", - "value": 3 + "json": 3 }, { - "command": 1, + "step": 2, "pointer": "/faces/0/v_curves", - "value": 3 + "json": 3 } ] } diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/expected.json index 36d5b98c4..0e459a0c8 100644 --- a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/expected.json +++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/expected.json @@ -5,9 +5,9 @@ "method": "box 40 x 30 x 20 with a corner at the origin: every face is flat: no radius (null)", "results": [ { - "command": 1, + "step": 2, "pointer": "/min_radius", - "value": null + "json": null } ] } diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/expected.json index c3f5fc8ef..72740f9a1 100644 --- a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/expected.json +++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/expected.json @@ -5,9 +5,9 @@ "method": "a cylinder r 5 on (60,0,0): its top edge is a circle of r 5", "results": [ { - "command": 1, + "step": 2, "pointer": "/min_radius", - "value": 5.0 + "json": 5.0 } ] } diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/expected.json index 72f5a8208..f58d68f9e 100644 --- a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/expected.json +++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/expected.json @@ -5,9 +5,9 @@ "method": "box 40 x 30 x 20 with a corner at the origin, its top-front edge (y 0, z 20) rounded r 3: the flat faces have none, the round is a cylinder of r 3: the smallest radius is 3", "results": [ { - "command": 2, + "step": 3, "pointer": "/min_radius", - "value": 3.0 + "json": 3.0 } ] } diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/expected.json index 3c8dd17bf..c7cbe1043 100644 --- a/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/expected.json +++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/expected.json @@ -5,9 +5,9 @@ "method": "ellipse a 10, b 4: tightest at the ends of the major axis, b^2 / a = 1.6, at (+-10, 0)", "results": [ { - "command": 3, + "step": 4, "pointer": "/min_radius", - "value": 1.6 + "json": 1.6 } ] }