You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A value that was never computed, returned through an API whose shape says it was measured. The
caller cannot tell the difference, because a fabricated answer and a real one have the same type,
the same plausible magnitude, and no error channel between them.
This keeps recurring, has been found by accident every time, and nothing in the tree looks for it.
Opening this to make it something we hunt rather than something we stumble into.
Confirmed instances
Production code returning a constant that reads as a measurement:
OCCTBridge_Healing.mm:248 — result.selfIntersectionCount = 0; // Would require more expensive computation. Every Shape.analyze() result has reported zero self-intersections since the field
existed. Not "none found": never looked. Documented as such only just now, in healed()/fixSolid() can demote a solid to a shell while reporting isValid == true #702's PR.
Censuses reporting a count nobody measured:#558 said 14, measured 28. #571 said 3, measured 6. #583 said five, measured six. #595 said six, measured nine. #640 said 13, measured 20. The pattern
is a count derived from a name prefix rather than from the behaviour.
Why it survives review
All three sub-kinds pass every gate we have. The value has the right type, so it compiles. It has a
plausible magnitude, so it does not look wrong. The test asserting it is green, so CI is green. A --self-test over it can be 6/6 while proving nothing, which is the exact failure okf/policies/prove-the-test-fails.md was written about after it happened twice in one script.
The common root is that absence and zero are spelled the same way. 0 self-intersections, 0
concave edges, 0.0 error, an empty array: each is both the "nothing here" answer and the "never
looked" answer, and the API offers no way to distinguish them. #583, #595 and #609 all resolved the
same way, by making the not-measured case representable (nil, a sentinel that cannot collide) so
the two stop sharing a spelling.
Proposed work
Sweep for the production form. Start from the 14 sites where a comment already admits it
(grep -rniE "would require|not implemented|placeholder|hardcod" over Sources/), then the
harder set: any bridge field assigned a literal on a path that reads like a computation. For each,
decide: compute it, make the absence representable, or remove the field. selfIntersectionCount
is the obvious first one, and removal looks right, since Shape.isSelfIntersecting(timeout:)
already answers it properly.
Consider a gate script. Detecting "this literal was never derived" is not decidable in
general, but the narrow form is: a struct field assigned only a literal across every path in its
own constructor. Worth a spike before committing to it.
Scope 1 and 2 for v2.0.0 if they stay tractable; the gate script is a follow-up.
The class
A value that was never computed, returned through an API whose shape says it was measured. The
caller cannot tell the difference, because a fabricated answer and a real one have the same type,
the same plausible magnitude, and no error channel between them.
This keeps recurring, has been found by accident every time, and nothing in the tree looks for it.
Opening this to make it something we hunt rather than something we stumble into.
Confirmed instances
Production code returning a constant that reads as a measurement:
OCCTBridge_Healing.mm:248—result.selfIntersectionCount = 0; // Would require more expensive computation. EveryShape.analyze()result has reported zero self-intersections since the fieldexisted. Not "none found": never looked. Documented as such only just now, in healed()/fixSolid() can demote a solid to a shell while reporting isValid == true #702's PR.
Shape.centerOfMassreturned the bounding-box centre. A number of the right type and abelievable magnitude, for a different quantity.
BRepGPropresults returned as successful answers, with the fabricated magnitudean open shell produces.
MaxError()reported 4.08e-15 unchanged from tolerance 1e-1 down to 1e-7, because thequantity it summed had been zeroed. A confidence number that was structurally incapable of moving.
joinBezierPatchesreportsIsDone() == truewhile having silently droppedthe weights.
math_GaussSetIntegrationreturnsIsDone() == trueand a wrong value for anyinput with more than one variable.
Tests pinning a hardcoded number that encodes the bug rather than the answer:
0.0volume. It never overlapped the box. The1was entirely the defect it was meant to guard.0.5. The correct value is1.0. The pinhad frozen a wrong answer as the expected one, and "fix the literal" would have frozen a second
wrong answer, since the class cannot produce
1.0at all.a pre-existing nonzero
gapCount. Computing the expected value from the real fields is whatstopped the test pinning a coincidence.
Censuses reporting a count nobody measured: #558 said 14, measured 28. #571 said 3, measured 6.
#583 said five, measured six. #595 said six, measured nine. #640 said 13, measured 20. The pattern
is a count derived from a name prefix rather than from the behaviour.
Why it survives review
All three sub-kinds pass every gate we have. The value has the right type, so it compiles. It has a
plausible magnitude, so it does not look wrong. The test asserting it is green, so CI is green. A
--self-testover it can be 6/6 while proving nothing, which is the exact failureokf/policies/prove-the-test-fails.mdwas written about after it happened twice in one script.The common root is that absence and zero are spelled the same way.
0self-intersections,0concave edges,
0.0error, an empty array: each is both the "nothing here" answer and the "neverlooked" answer, and the API offers no way to distinguish them. #583, #595 and #609 all resolved the
same way, by making the not-measured case representable (
nil, a sentinel that cannot collide) sothe two stop sharing a spelling.
Proposed work
(
grep -rniE "would require|not implemented|placeholder|hardcod"overSources/), then theharder set: any bridge field assigned a literal on a path that reads like a computation. For each,
decide: compute it, make the absence representable, or remove the field.
selfIntersectionCountis the obvious first one, and removal looks right, since
Shape.isSelfIntersecting(timeout:)already answers it properly.
#expect(x.count == <literal>)on a fixture whose geometry nobodyre-derived. The check that works is the OCCTEdgeGetConvexity depends on face argument order, so detectPocketsAAG() reports a pocket on a plain convex box #703 one: assert the fixture does what its name says
(volume actually removed, faces actually shared) before asserting the count. A pinned count with
no accompanying assertion about the fixture is the smell.
general, but the narrow form is: a struct field assigned only a literal across every path in its
own constructor. Worth a spike before committing to it.
Scope 1 and 2 for v2.0.0 if they stay tractable; the gate script is a follow-up.
Related: #605, #609, #583, #595, #522, #640, #703, #725. Policy:
okf/policies/prove-the-test-fails.md.