Skip to content

Conversation

@Shastick
Copy link
Contributor

@Shastick Shastick commented Oct 24, 2025

Add an error margin when checking for specific USS behavior around specific thresholds, such as the maximum diagonal of an observed area.

This updates the display provider maximum allowed area observation

(Updating other checks such as the clustering thresholds require some unrelated adaptations and will happen in a separate PR)

Notes

Some context from a Slack thread:

[...] uss_qualifier's spherical approximation method is not as accurate as Vincenty's ellipsoidal approximation, so it indeed requests too large of a diagonal by the 1.9 meters noted. This is a little unintuitive because uss_qualifier's spherical approximation is larger than the Vincenty ellipsoid, yet Vincenty produces a larger distance (and therefore we should expect uss_qualifier to overestimate distance, but instead it under estimates distance). My understanding is that this is because the circles of the same latitude are sometimes larger on the ellipsoid even though the overall ellipsoid is smaller.

[...] In general, when we're checking a limit X, we shouldn't send exactly X because systems differ in the computations and comparisons and therefore exact equality in floating points is never a good idea outside of special values like 0. Instead, we should send X-sigma or X*(1-sigma) to check that values less than X are accepted, where sigma is a constant describing how large of a computation difference is acceptable. In the case of distances, an LLM tells me the maximum distance error between uss_qualifier's less-correct spherical model and a more-correct ellipsoidal model like Vincenty is 0.674%. So, we should pick a diagonal of 7000*(1-0.00674) meters to verify that participants accept large but valid diagonals. (but probably round up a bit to account for other sources of computation difference, so perhaps use 0.7% instead)

@Shastick Shastick force-pushed the dp-behavior-limit-margin branch 2 times, most recently from b18fdb5 to 965fc14 Compare October 24, 2025 12:28
# than uss_qualifier. We thus accept an error margin of 0.7% around distance limits and thresholds
# to avoid failing USSes for minor differences in precision whenever the relevant standard is not
# prescriptive in that regard.
DISTANCE_ERROR_TOLERANCE_PERCENT = 0.007
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.007 is presumably the DISTANCE_ERROR_TOLERANCE_FRACTION that we want in order to achieve a DISTANCE_ERROR_TOLERANCE_PERCENT of 0.7

Suggested change
DISTANCE_ERROR_TOLERANCE_PERCENT = 0.007
DISTANCE_ERROR_TOLERANCE_FRACTION = 0.007

or

Suggested change
DISTANCE_ERROR_TOLERANCE_PERCENT = 0.007
DISTANCE_ERROR_TOLERANCE_PERCENT = 0.7

@Shastick Shastick force-pushed the dp-behavior-limit-margin branch from 965fc14 to 94fa99e Compare October 26, 2025 16:46
@Shastick Shastick marked this pull request as ready for review October 26, 2025 16:47
@Shastick Shastick force-pushed the dp-behavior-limit-margin branch 2 times, most recently from ad2dc34 to e95c4b7 Compare October 26, 2025 19:41
@Shastick Shastick marked this pull request as draft October 26, 2025 19:41
@Shastick Shastick force-pushed the dp-behavior-limit-margin branch from e95c4b7 to 915c5e4 Compare October 26, 2025 19:55
@Shastick Shastick marked this pull request as ready for review October 26, 2025 20:00
QueryType.F3411v22aUSSGetFlightDetails,
]

# Different spherical models have different precisions: implementations may use a different model
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it's not different spherical models, it's just different models for the shape of the Earth. Specifically, the more-accurate ellipsoidal model can be off from our less-accurate spherical model by a little under 0.7%.

@BenjaminPelletier BenjaminPelletier merged commit f01f9ea into interuss:main Oct 27, 2025
21 checks passed
github-actions bot added a commit that referenced this pull request Oct 27, 2025
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.

2 participants