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
OCCT#1417 is our upstream filing of carried
patch 0018 (#555, GCPnts degenerate count and duplicate end point). Maintainer gkv311 reviewed it on 2026-08-03
with three requested changes. It has been sitting unanswered since.
The three are not cosmetic in equal measure: the first is a design decision that lands differently
in our build than in a stock one, and it needs deciding rather than picking whichever wording is
shorter.
The three requests
1. The No_Exception duplicate guard, which is the real one
We wrote, in both GCPnts_QuasiUniformAbscissa::initialize and GCPnts_UniformAbscissa::initialize:
Standard_ConstructionError_Raise_if(theNbPoints <= 1, "...");
if (theNbPoints <= 1)
{
// The check above is compiled out in a build defining No_Exception.
myDone = false; myNbPoints = 0; return;
}
gkv311's objection is that *_Raise_if is an assert-grade macro, deliberately compiled out in
release for overhead, and that duplicating it is the wrong shape. He offers two fixes:
(a) replace the macro with an unconditional if (...) throw Standard_ConstructionError(...);
(b) "remove this duplicating check and keep only myDone=false;"
Read (b) carefully before implementing it. Taken literally in QuasiUniformAbscissa it is a
regression: deleting the block removes the return as well, and execution falls through into the
store to myParams, which is allocated empty for that count. That store is the entire defect #555
reported. What (b) has to mean is replace the _Raise_if with { myDone = false; myNbPoints = 0; return; }, not delete anything. Note that UniformAbscissa's site already assigns both fields
above the guard, so only the early return is load-bearing there, which is exactly the kind of
asymmetry that makes a one-line review instruction ambiguous.
Why the choice is ours to make and not a coin flip. We build with BUILD_RELEASE_DISABLE_EXCEPTIONS=ON, which defines No_Exception, so today the macro is gone in
our kernel and the guard we added is the only thing standing there. Under (a) a degenerate count
starts throwing in our build, where it currently cannot; under (b) it stays a silent not-done.
Does anything in OCCT itself call these with a caller-supplied count it does not pre-validate?
If both options preserve our observable contract, prefer (b): it keeps the degenerate case a
not-done result rather than an exception, which is what #555 argued for, and it is the option that
does not depend on whether the consumer defines No_Exception. Say so in the reply, with the
measurement, rather than just complying.
OCCT convention is SquareDistance() against a tolerance squared once outside the loop. Mechanical,
but hoist the aTol2 computation properly rather than squaring inline each iteration.
3. theTol3d is misleading
The Perform template also instantiates on Adaptor2d_Curve2d, so the name asserts something false
for half its uses. Rename to theTol. Check for shadowing against the enclosing initialize's own theTol at the call sites.
Scope
Update Scripts/patches/0018-GCPnts-degenerate-count-and-duplicate-end-point-555.patch to the
revised form. This is the artifact of record; the upstream PR is downstream of it.
Re-run Scripts/repro/555-gcpnts-count-contract and confirm its verdict is unchanged. If the
verdict moves, the review has changed behaviour and that is the finding, not a detail.
Update Scripts/patches/README.md's 0018 section if the rationale changed.
Prepare the exact commit for gsdali/OCCT's fix/555-gcpnts-point-count branch as a patch file
under the repro dir, with the reply to gkv311 drafted alongside it.
Do not push to gsdali/OCCT or comment on OCCT#1417. Both are outward-facing and need
authorisation. Prepare them and stop.
Not in scope
Changing what the fix does. The reviewer accepted the substance and asked about form; the two
degenerate-count contracts and the duplicate-end-point suppression stay as they are.
OCCT#1417 is our upstream filing of carried
patch
0018(#555,GCPntsdegenerate count and duplicate end point). Maintainer gkv311reviewed it on 2026-08-03
with three requested changes. It has been sitting unanswered since.
The three are not cosmetic in equal measure: the first is a design decision that lands differently
in our build than in a stock one, and it needs deciding rather than picking whichever wording is
shorter.
The three requests
1. The
No_Exceptionduplicate guard, which is the real oneWe wrote, in both
GCPnts_QuasiUniformAbscissa::initializeandGCPnts_UniformAbscissa::initialize:gkv311's objection is that
*_Raise_ifis an assert-grade macro, deliberately compiled out inrelease for overhead, and that duplicating it is the wrong shape. He offers two fixes:
if (...) throw Standard_ConstructionError(...);myDone=false;"Read (b) carefully before implementing it. Taken literally in
QuasiUniformAbscissait is aregression: deleting the block removes the
returnas well, and execution falls through into thestore to
myParams, which is allocated empty for that count. That store is the entire defect #555reported. What (b) has to mean is replace the
_Raise_ifwith{ myDone = false; myNbPoints = 0; return; }, not delete anything. Note thatUniformAbscissa's site already assigns both fieldsabove the guard, so only the early return is load-bearing there, which is exactly the kind of
asymmetry that makes a one-line review instruction ambiguous.
Why the choice is ours to make and not a coin flip. We build with
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON, which definesNo_Exception, so today the macro is gone inour kernel and the guard we added is the only thing standing there. Under (a) a degenerate count
starts throwing in our build, where it currently cannot; under (b) it stays a silent not-done.
Measure before choosing, do not reason it out:
initializeoverloads, and does each sit inside acatch (...)? An uncaughtStandard_ConstructionErrorcrossing into Swift frames is astd::terminate(), which is the Uncatchable SIGABRT in parallel swift test run — cause unknown, very little evidence (see #344 for the companion SIGSEGV) #345 mechanism.in the repo assert it? Whichever option is chosen must not change that answer.
If both options preserve our observable contract, prefer (b): it keeps the degenerate case a
not-done result rather than an exception, which is what #555 argued for, and it is the option that
does not depend on whether the consumer defines
No_Exception. Say so in the reply, with themeasurement, rather than just complying.
2.
Distance()in a loopOCCT convention is
SquareDistance()against a tolerance squared once outside the loop. Mechanical,but hoist the
aTol2computation properly rather than squaring inline each iteration.3.
theTol3dis misleadingThe
Performtemplate also instantiates onAdaptor2d_Curve2d, so the name asserts something falsefor half its uses. Rename to
theTol. Check for shadowing against the enclosinginitialize's owntheTolat the call sites.Scope
Scripts/patches/0018-GCPnts-degenerate-count-and-duplicate-end-point-555.patchto therevised form. This is the artifact of record; the upstream PR is downstream of it.
note applies: override TUs for these files need
-DNo_Exceptionto reproduce the build thepatch is written for, and without it you will measure the wrong branch.
Scripts/repro/555-gcpnts-count-contractand confirm its verdict is unchanged. If theverdict moves, the review has changed behaviour and that is the finding, not a detail.
produces today.
Scripts/patches/README.md's0018section if the rationale changed.gsdali/OCCT'sfix/555-gcpnts-point-countbranch as a patch fileunder the repro dir, with the reply to gkv311 drafted alongside it.
Do not push to
gsdali/OCCTor comment on OCCT#1417. Both are outward-facing and needauthorisation. Prepare them and stop.
Not in scope
Changing what the fix does. The reviewer accepted the substance and asked about form; the two
degenerate-count contracts and the duplicate-end-point suppression stay as they are.