Disclose how much of the sphere a mesh covers - #129
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A 5-degree mesh spanning 0-40E/0-40N with
sphere_radius: 6371000.0returnedtotal_area: 22936016715559.137 m^2(4.4967% of4*pi*R^2) withscientific_status: complete, no warning code, and a barepostconditions: not_evaluated, and the identical call on a global mesh returned 1.0000 of the sphere with the same status shape.calculate_areaandinspect_meshnow carry amesh_coverageblock (sphere_fraction,closed,euler_characteristic,lon_extent,lat_extent); a patch raisesMESH_NOT_GLOBALand drops towarningbut stays interpretable, and an abstained postcondition carriesnot_evaluated_because. Geometry and topology are reported separately because they can honestly disagree (a 1-degree grid reads 0.999963 andclosed: false), and above 250,000 faces the topological half is skipped withtopology_skippedrather than guessed.Closes #33