Skip to content

Disclose how much of the sphere a mesh covers - #129

Merged
rajeeja merged 1 commit into
mainfrom
rajeeja/mesh-coverage
Sep 6, 2026
Merged

Disclose how much of the sphere a mesh covers#129
rajeeja merged 1 commit into
mainfrom
rajeeja/mesh-coverage

Conversation

@rajeeja

@rajeeja rajeeja commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

A 5-degree mesh spanning 0-40E/0-40N with sphere_radius: 6371000.0 returned total_area: 22936016715559.137 m^2 (4.4967% of 4*pi*R^2) with scientific_status: complete, no warning code, and a bare postconditions: not_evaluated, and the identical call on a global mesh returned 1.0000 of the sphere with the same status shape. calculate_area and inspect_mesh now carry a mesh_coverage block (sphere_fraction, closed, euler_characteristic, lon_extent, lat_extent); a patch raises MESH_NOT_GLOBAL and drops to warning but stays interpretable, and an abstained postcondition carries not_evaluated_because. Geometry and topology are reported separately because they can honestly disagree (a 1-degree grid reads 0.999963 and closed: false), and above 250,000 faces the topological half is skipped with topology_skipped rather than guessed.

Closes #33

A 5-degree mesh spanning 0-40E/0-40N with sphere_radius 6371000.0 returned
total_area 22936016715559.137 m^2 -- 4.4967% of 4*pi*R^2 -- with
scientific_status complete, physically_interpretable true, no warning code,
and a bare postconditions {status: not_evaluated, checks: []}. The identical
call on a global mesh returned 1.0000 of the sphere with the same status
shape. Nothing in either payload said which was which.

calculate_area and inspect_mesh now both carry a mesh_coverage block:
sphere_fraction, closed, euler_characteristic, lon_extent, lat_extent. A
patch raises MESH_NOT_GLOBAL and drops to warning but stays interpretable,
because the area of a patch is a real physical quantity and only the missing
disclosure was wrong.

Geometry and topology are reported separately and are allowed to disagree. A
1-degree structured global grid stops half a cell short of each pole, so it
reads sphere_fraction 0.999963 with closed false and 720 boundary edges;
both facts are true and a single globality verdict would have to suppress
one. Counting edge incidences is a Python loop -- 1.43 s at 196,608 faces,
5.99 s at 786,432 -- so above 250,000 faces the topological half is skipped
and closed comes back null with topology_skipped giving the reason, never
false.

An abstained postcondition now says why. The area identity holds only on a
closed mesh, so a regional result was indistinguishable from a deployment
running verdict_policy off. postcondition_block carries
not_evaluated_because when the server can name a reason, read off
mesh_coverage so naming it costs no second traversal.

mesh_is_closed and _canonical_node_ids move from postconditions to the new
domain module; postconditions reuses the already-computed block and falls
back to counting only for a remote worker on an older build that sends no
coverage. Payload budgets rise 1150 -> 1300 and 1800 -> 1950 for the 151
bytes the block costs, after trimming it: the raw steradian sum is dropped
(it is 4*pi * sphere_fraction) and floats round to 1e-6, which is 510 km^2
of sphere and 0.1 m of arc.

Closes #33
@rajeeja
rajeeja merged commit bcfce41 into main Sep 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant