Skip to content

mesh-compile: deviation bounds leave out the rounding of applying an instance's transform far from the origin #295

Open

Description

@GeneralPawz

Found while fixing #258. A deviation bound for an instanced body is the source's bound grown by the transform's stretch, a relative factor (#258 also shrinks the source budget so the product fits). The vertices, however, are moved by applying the f64 transform, which rounds each coordinate by a few ulps of its magnitude. That is an absolute error of roughly ε × the distance from the origin: about 1e-13 at 1e3 units, and about 1e-9 at georeferenced coordinates of about 6e6. No relative factor covers it, so a mesh placed far from the origin can lie further from the exact surface than its reported Proven or Certified bound, by that rounding.

The rest of the crate also leaves out the rounding of computing a construction's own vertices. The deviation.rs docs now say so explicitly.

Needed

  • Decide and document the rule. Either:
    • add an absolute rounding term to every reported bound, about c · ε · max|coordinate| per transform applied, plus vertex-construction rounding, and leave room for it in the source's budget; or
    • state in ADR 0080 or the deviation docs that bounds are exact-arithmetic bounds and exclude f64 vertex rounding, so consumers add it.
  • If the term is added, a budget too close to the rounding at the placement scale is refused by name rather than reported as met.

Done when

  • A torus instanced at (6e6, 6e6, 100) with a 1e-9 budget either reports a bound that holds under dense sampling in f64, or is refused by name.
  • The rule is stated in the deviation docs and ADR, and a test pins it.

Activity

  1. GeneralPawz commented on Oct 12, 2026

    @GeneralPawz
    ContributorAuthor

    Triage: accepted, medium, scheduled after the next wave. Decision: reported bounds include an absolute rounding term for each transform applied (c·ε·max|coordinate|, with the constant derived and stated). The source budget leaves room for it, and a budget below that floor at the placement scale is refused by name rather than reported as met. ADR 0080 states the rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions