@automovie/recovery 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/curves/AutoMovieRecoveryCompactApproximation.d.ts +125 -0
  2. package/lib/curves/AutoMovieRecoveryCompactApproximation.js +62 -0
  3. package/lib/curves/AutoMovieRecoveryCompactApproximation.js.map +1 -0
  4. package/lib/curves/AutoMovieRecoveryConicApproximation.d.ts +218 -0
  5. package/lib/curves/AutoMovieRecoveryConicApproximation.js +113 -0
  6. package/lib/curves/AutoMovieRecoveryConicApproximation.js.map +1 -0
  7. package/lib/curves/approximateAutoMovieRecoveryCompactCurves.d.ts +30 -0
  8. package/lib/curves/approximateAutoMovieRecoveryCompactCurves.js +303 -0
  9. package/lib/curves/approximateAutoMovieRecoveryCompactCurves.js.map +1 -0
  10. package/lib/curves/approximateAutoMovieRecoveryConicsAhn.d.ts +39 -0
  11. package/lib/curves/approximateAutoMovieRecoveryConicsAhn.js +289 -0
  12. package/lib/curves/approximateAutoMovieRecoveryConicsAhn.js.map +1 -0
  13. package/lib/curves/approximateAutoMovieRecoveryConicsGhosh.d.ts +32 -0
  14. package/lib/curves/approximateAutoMovieRecoveryConicsGhosh.js +350 -0
  15. package/lib/curves/approximateAutoMovieRecoveryConicsGhosh.js.map +1 -0
  16. package/lib/curves/findAutoMovieRecoveryCubicCriticalParameters.d.ts +29 -0
  17. package/lib/curves/findAutoMovieRecoveryCubicCriticalParameters.js +77 -0
  18. package/lib/curves/findAutoMovieRecoveryCubicCriticalParameters.js.map +1 -0
  19. package/lib/curves/index.d.ts +5 -0
  20. package/lib/curves/index.js +5 -0
  21. package/lib/curves/index.js.map +1 -1
  22. package/lib/internal/GhoshConicApproximationBalance.d.ts +25 -0
  23. package/lib/internal/GhoshConicApproximationBalance.js +177 -0
  24. package/lib/internal/GhoshConicApproximationBalance.js.map +1 -0
  25. package/lib/internal/GhoshConicApproximationDisplacement.d.ts +23 -0
  26. package/lib/internal/GhoshConicApproximationDisplacement.js +77 -0
  27. package/lib/internal/GhoshConicApproximationDisplacement.js.map +1 -0
  28. package/lib/internal/index.d.ts +2 -0
  29. package/lib/internal/index.js +2 -0
  30. package/lib/internal/index.js.map +1 -1
  31. package/package.json +6 -6
  32. package/src/curves/AutoMovieRecoveryCompactApproximation.ts +149 -0
  33. package/src/curves/AutoMovieRecoveryConicApproximation.ts +282 -0
  34. package/src/curves/approximateAutoMovieRecoveryCompactCurves.ts +285 -0
  35. package/src/curves/approximateAutoMovieRecoveryConicsAhn.ts +315 -0
  36. package/src/curves/approximateAutoMovieRecoveryConicsGhosh.ts +444 -0
  37. package/src/curves/findAutoMovieRecoveryCubicCriticalParameters.ts +76 -0
  38. package/src/curves/index.ts +5 -0
  39. package/src/internal/GhoshConicApproximationBalance.ts +184 -0
  40. package/src/internal/GhoshConicApproximationDisplacement.ts +83 -0
  41. package/src/internal/index.ts +2 -0
@@ -0,0 +1,125 @@
1
+ import { AutoMovieRecoveryConicApproximation as Conic } from "./AutoMovieRecoveryConicApproximation";
2
+ /**
3
+ * Planar coefficient-reduction experiment, independent of source meshes.
4
+ *
5
+ * @evidence contracts/development/common.md#meaningful-documentation Defines physical units, source observation knots, coefficient charts and sampled evidence limits.
6
+ * @evidence contracts/development/design.md#principled-representation Discriminated polynomial and positive rational coefficients retain domains and millimetre coordinates.
7
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Recovery owns the fitter contract used by the experiment and portable tests; the existing planar source contract is reused.
8
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No specimen, baked observation, mesh fallback or global-minimum claim is represented.
9
+ */
10
+ export declare namespace AutoMovieRecoveryCompactApproximation {
11
+ /**
12
+ * Source knots are observation locations, not mandatory output boundaries.
13
+ * The inherited breaks alone identify actual corners that cannot be crossed.
14
+ *
15
+ * @evidence contracts/development/common.md#meaningful-documentation Separates source sampling support from immutable feature boundaries and inherits millimetre callback units.
16
+ * @evidence contracts/development/design.md#principled-representation A readonly interior knot list records piecewise source support without forcing its old representation into the result.
17
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Extends the existing planar callback owner only with support needed by fitting and independent checks.
18
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No source controls or anatomy-specific measurements enter this generic contract.
19
+ */
20
+ interface ICurve extends Conic.ICurve {
21
+ /** Every source piece boundary, strictly inside domain, for observation coverage. */
22
+ knots: readonly number[];
23
+ }
24
+ /**
25
+ * Error and finite work controls for a fixed-degree or storage-selected fit.
26
+ *
27
+ * @evidence contracts/development/common.md#meaningful-documentation States geometric tolerance, candidate degrees and distinct output, subdivision and callback budgets.
28
+ * @evidence contracts/development/design.md#principled-representation Closed degree choices prevent unsupported fitting modes; positive finite limits require runtime admission.
29
+ * @evidence contracts/development/design.md#minimal-and-owned-surface These controls are read by the current fitter and comparison consumer.
30
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No specimen preset, hidden quality mode or tolerance relaxation is supplied.
31
+ */
32
+ interface IOptions {
33
+ /** Maximum admitted held-out correspondence discrepancy, millimetres. */
34
+ toleranceMm: number;
35
+ /** Mixed admits one conic and polynomial degrees three through five. */
36
+ degree: 3 | 4 | 5 | "mixed";
37
+ /** Maximum accepted plus unresolved leaf pieces. */
38
+ maximumPieces: number;
39
+ /** Maximum binary subdivision depth per initial chart. */
40
+ maximumDepth: number;
41
+ /** Maximum source evaluate/derivative invocations, including conic fitting. */
42
+ maximumQueries: number;
43
+ }
44
+ /**
45
+ * Source-registered polynomial or bitangent conic coefficient record.
46
+ * Polynomial u=(t-a)/(b-a); a conic's u is its own rational parameter.
47
+ *
48
+ * @evidence contracts/development/common.md#meaningful-documentation Distinguishes source registration from rational speed and identifies sampled error and millimetre controls.
49
+ * @evidence contracts/development/design.md#principled-representation The closed union requires exactly the fields for polynomial or normalized rational evaluation.
50
+ * @evidence contracts/development/design.md#minimal-and-owned-surface One union supports fitting, coefficient-only generation and storage comparison.
51
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No source evaluator or dense sample table is retained in output.
52
+ */
53
+ type IPiece = {
54
+ /** Selects polynomial Bernstein evaluation and linear source registration. */
55
+ kind: "polynomial";
56
+ /** Actual polynomial degree; there are degree plus one planar controls. */
57
+ degree: 3 | 4 | 5;
58
+ /** Ordered original source interval, in the callback's parameter unit. */
59
+ domain: readonly [number, number];
60
+ /** Bernstein controls in the source's planar millimetre coordinate frame. */
61
+ controls: readonly Conic.Point[];
62
+ /** Largest observed fitting/held-out correspondence discrepancy, millimetres. */
63
+ maximumSampleErrorMm: number;
64
+ } | {
65
+ /** Selects rational quadratic evaluation with independent local speed. */
66
+ kind: "conic";
67
+ /** Source interval represented by this conic, without equal-speed implication. */
68
+ domain: readonly [number, number];
69
+ /** Planar millimetre endpoint, tangent intersection, endpoint coefficients. */
70
+ controls: readonly [Conic.Point, Conic.Point, Conic.Point];
71
+ /** Positive dimensionless middle weight; both endpoint weights are one. */
72
+ weight: number;
73
+ /** Largest fitting/held-out radial correspondence discrepancy, millimetres. */
74
+ maximumSampleErrorMm: number;
75
+ };
76
+ /**
77
+ * Admitted coefficients, omitted-domain status and explicit evidence scope.
78
+ *
79
+ * @evidence contracts/development/common.md#meaningful-documentation Defines completion as sampled fit coverage, not continuous error, topology or likeness certification.
80
+ * @evidence contracts/development/design.md#principled-representation The status union and immutable coefficients distinguish complete, incomplete and empty refused outputs.
81
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The comparison consumes every reported measurement, including numeric storage and callback cost.
82
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts certified is always false because held-out samples do not establish continuous Hausdorff bounds.
83
+ */
84
+ interface IResult {
85
+ /** Whether sampled fitting covered the entire requested domain, only part, or none. */
86
+ status: "complete" | "partial" | "refused";
87
+ /** Ordered admitted coefficient records; omitted domains have no fabricated piece. */
88
+ pieces: readonly IPiece[];
89
+ /** Maximum sampled discrepancy across retained pieces, millimetres; zero when empty. */
90
+ maximumSampleErrorMm: number;
91
+ /** Numeric coefficient/chart count under storedScalars' planar seam-sharing convention. */
92
+ storedScalars: number;
93
+ /** Actual source position and derivative callback invocations, including nested conic fitting. */
94
+ queries: number;
95
+ /** Representation limitations, numerical admission failures and omitted-domain reasons. */
96
+ diagnostics: readonly string[];
97
+ /** Always false: finite fitting/held-out observations are not continuous error certificates. */
98
+ certified: false;
99
+ }
100
+ /**
101
+ * Evaluate only saved coefficients at the piece's own normalized parameter.
102
+ *
103
+ * @evidence contracts/development/common.md#meaningful-documentation States normalized parameter and millimetre output, and does not borrow a source evaluator.
104
+ * @evidence contracts/development/implementation.md#principled-implementation Existing engine Bernstein evaluation and the existing rational conic quotient implement the two admitted representations.
105
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One dispatch keeps generation and fitter coefficient semantics identical.
106
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No resampling, source interpolation or fallback curve changes stored coefficients.
107
+ * @evidence contracts/development/implementation.md#efficient-algorithms Degree is at most five; two scalar Bernstein evaluations use constant bounded work and storage.
108
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Rational evaluation reuses the existing conic owner; polynomial evaluation reuses engine algebra.
109
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Temporary scalar arrays expire after each pure call; no input or handle is retained.
110
+ */
111
+ function evaluate(piece: IPiece, u: number): Conic.Point;
112
+ /**
113
+ * Count the actual planar numeric representation, including chart metadata.
114
+ * Adjacent equal endpoints are counted once; corners may share position.
115
+ *
116
+ * @evidence contracts/development/common.md#meaningful-documentation Defines two coordinates per control, one degree or weight, two interval endpoints and exact shared-endpoint accounting.
117
+ * @evidence contracts/development/implementation.md#principled-implementation Direct coefficient cardinality measures stored numbers rather than output tessellation or source observation counts.
118
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The same owner supplies candidate and final representation cost.
119
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Coordinate plane reduction is not attributed to polynomial degree, and no approximate endpoint equality hides a gap.
120
+ * @evidence contracts/development/implementation.md#efficient-algorithms One pass over P pieces costs O(P) with scalar scratch only.
121
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Adjacent controls are read once per seam; no sample generation is needed.
122
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The function borrows the immutable coefficient array and retains no data after return.
123
+ */
124
+ function storedScalars(pieces: readonly IPiece[]): number;
125
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AutoMovieRecoveryCompactApproximation = void 0;
4
+ const engine_1 = require("@automovie/engine");
5
+ const AutoMovieRecoveryConicApproximation_1 = require("./AutoMovieRecoveryConicApproximation");
6
+ /**
7
+ * Planar coefficient-reduction experiment, independent of source meshes.
8
+ *
9
+ * @evidence contracts/development/common.md#meaningful-documentation Defines physical units, source observation knots, coefficient charts and sampled evidence limits.
10
+ * @evidence contracts/development/design.md#principled-representation Discriminated polynomial and positive rational coefficients retain domains and millimetre coordinates.
11
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Recovery owns the fitter contract used by the experiment and portable tests; the existing planar source contract is reused.
12
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No specimen, baked observation, mesh fallback or global-minimum claim is represented.
13
+ */
14
+ var AutoMovieRecoveryCompactApproximation;
15
+ (function (AutoMovieRecoveryCompactApproximation) {
16
+ /**
17
+ * Evaluate only saved coefficients at the piece's own normalized parameter.
18
+ *
19
+ * @evidence contracts/development/common.md#meaningful-documentation States normalized parameter and millimetre output, and does not borrow a source evaluator.
20
+ * @evidence contracts/development/implementation.md#principled-implementation Existing engine Bernstein evaluation and the existing rational conic quotient implement the two admitted representations.
21
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One dispatch keeps generation and fitter coefficient semantics identical.
22
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No resampling, source interpolation or fallback curve changes stored coefficients.
23
+ * @evidence contracts/development/implementation.md#efficient-algorithms Degree is at most five; two scalar Bernstein evaluations use constant bounded work and storage.
24
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Rational evaluation reuses the existing conic owner; polynomial evaluation reuses engine algebra.
25
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Temporary scalar arrays expire after each pure call; no input or handle is retained.
26
+ */
27
+ function evaluate(piece, u) {
28
+ if (piece.kind === "conic")
29
+ return AutoMovieRecoveryConicApproximation_1.AutoMovieRecoveryConicApproximation.evaluate(piece, u);
30
+ return [
31
+ engine_1.AutoMovieBernstein64.scalar(piece.controls.map((p) => p[0]), u),
32
+ engine_1.AutoMovieBernstein64.scalar(piece.controls.map((p) => p[1]), u),
33
+ ];
34
+ }
35
+ AutoMovieRecoveryCompactApproximation.evaluate = evaluate;
36
+ /**
37
+ * Count the actual planar numeric representation, including chart metadata.
38
+ * Adjacent equal endpoints are counted once; corners may share position.
39
+ *
40
+ * @evidence contracts/development/common.md#meaningful-documentation Defines two coordinates per control, one degree or weight, two interval endpoints and exact shared-endpoint accounting.
41
+ * @evidence contracts/development/implementation.md#principled-implementation Direct coefficient cardinality measures stored numbers rather than output tessellation or source observation counts.
42
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The same owner supplies candidate and final representation cost.
43
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Coordinate plane reduction is not attributed to polynomial degree, and no approximate endpoint equality hides a gap.
44
+ * @evidence contracts/development/implementation.md#efficient-algorithms One pass over P pieces costs O(P) with scalar scratch only.
45
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Adjacent controls are read once per seam; no sample generation is needed.
46
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The function borrows the immutable coefficient array and retains no data after return.
47
+ */
48
+ function storedScalars(pieces) {
49
+ let total = 0;
50
+ let previous;
51
+ for (const piece of pieces) {
52
+ total += 2 * piece.controls.length + 3;
53
+ const first = piece.controls[0];
54
+ if (previous !== undefined && previous[0] === first[0] && previous[1] === first[1])
55
+ total -= 2;
56
+ previous = piece.controls.at(-1);
57
+ }
58
+ return total;
59
+ }
60
+ AutoMovieRecoveryCompactApproximation.storedScalars = storedScalars;
61
+ })(AutoMovieRecoveryCompactApproximation || (exports.AutoMovieRecoveryCompactApproximation = AutoMovieRecoveryCompactApproximation = {}));
62
+ //# sourceMappingURL=AutoMovieRecoveryCompactApproximation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoMovieRecoveryCompactApproximation.js","sourceRoot":"","sources":["../../src/curves/AutoMovieRecoveryCompactApproximation.ts"],"names":[],"mappings":";;;AAAA,8CAA8D;AAE9D,+FAAqG;AAErG;;;;;;;GAOG;AACH,IAAiB,qCAAqC,CAwIrD;AAxID,WAAiB,qCAAqC;IA8FpD;;;;;;;;;;OAUG;IACH,SAAgB,QAAQ,CAAC,KAAa,EAAE,CAAS;QAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;YAAE,OAAO,yEAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC5D,OAAO;YACL,6BAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAc,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACjE,6BAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAc,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAClE,CAAC;IACJ,CAAC;IANe,sCAAA,QAAQ,WAMvB,CAAA;IAED;;;;;;;;;;;OAWG;IACH,SAAgB,aAAa,CAAC,MAAyB;QACrD,IAAI,KAAK,GAAW,CAAC,CAAC;QACtB,IAAI,QAAiC,CAAC;QACtC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YACvC,MAAM,KAAK,GAAgB,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC;YAC9C,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;gBAAE,KAAK,IAAI,CAAC,CAAC;YAC/F,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC;QACpC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAVe,sCAAA,aAAa,gBAU5B,CAAA;AACH,CAAC,EAxIgB,qCAAqC,aAArC,qCAAqC,GAArC,qCAAqC,QAwIrD"}
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Shared planar, millimetre-valued contract for experimental conic recovery.
3
+ * Rational quadratics use endpoint weights one and a positive middle weight;
4
+ * a collinear control triple with weight one is the admitted line primitive.
5
+ * The contract does not imply a Hausdorff certificate or a globally minimal net.
6
+ *
7
+ * @evidence contracts/development/common.md#meaningful-documentation States units, coefficient normalization, line representation and the limits of reported evidence.
8
+ * @evidence contracts/development/design.md#principled-representation Readonly planar tuples and explicit domains represent source charts and conic coefficients; finite values, positive weights and ordered domains require runtime admission.
9
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Recovery owns the shared contract consumed by the two paper experiments and their reconstruction caller.
10
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No specimen, source artifact, rendering option or optional algorithm-specific state enters this planar contract.
11
+ */
12
+ export declare namespace AutoMovieRecoveryConicApproximation {
13
+ /**
14
+ * A point or derivative in the caller's fixed planar millimetre frame.
15
+ *
16
+ * @evidence contracts/development/common.md#meaningful-documentation States the fixed frame and physical unit; derivative orders inherit the source parameter.
17
+ * @evidence contracts/development/design.md#principled-representation A readonly two-tuple excludes changing dimension; finite arithmetic remains a runtime condition.
18
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Both algorithms and their caller share this single point owner.
19
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No fixture-specific axes or numeric wrapper is introduced.
20
+ */
21
+ type Point = readonly [number, number];
22
+ /**
23
+ * Borrowed parametric planar source, with source-span and singularity breaks.
24
+ * Derivatives are with respect to the original parameter, not normalized arc
25
+ * length. At a declared break the derivative callback must supply the exact
26
+ * requested one-sided limit; no epsilon displacement approximates a corner.
27
+ * Smooth callbacks may ignore side. Callbacks must be deterministic and leave
28
+ * their input unchanged; algorithms snapshot returned coordinate tuples.
29
+ *
30
+ * @evidence contracts/development/common.md#meaningful-documentation Documents callback parameterization, exact one-sided derivatives at breaks, domain, breaks and coordinate snapshot ownership.
31
+ * @evidence contracts/development/design.md#principled-representation The ordered domain and derivatives through order five support both papers; regularity is checked numerically by the selected algorithm.
32
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Recovery accepts a pure evaluator so source basis and artifact I/O remain with existing owners.
33
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The interface accepts arbitrary planar source charts without a Human or polynomial-degree dependency.
34
+ */
35
+ interface ICurve {
36
+ /** Inclusive source parameter interval, strictly increasing. */
37
+ domain: readonly [number, number];
38
+ /** Ordered or unordered interior parameter boundaries that may not be crossed. */
39
+ breaks: readonly number[];
40
+ /** Whether the source identifies its two domain endpoints. */
41
+ closed: boolean;
42
+ /**
43
+ * Evaluate in millimetres; nonfinite coordinates refuse the affected arc.
44
+ *
45
+ * @evidence contracts/development/common.md#meaningful-documentation States the unit of the returned point and what a nonfinite coordinate does to the arc that reads it; the interface comment states determinism and input ownership.
46
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation The point evaluator is a callback the caller supplies: this declaration has no body whose method could be judged.
47
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure The point evaluator is a callback the caller supplies: no structure is implemented here.
48
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts The point evaluator is a callback the caller supplies: no implementation exists here to take a shortcut.
49
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms The point evaluator is a callback the caller supplies: its cost belongs to the supplied source.
50
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The point evaluator is a callback the caller supplies: the algorithms that call it own their caching.
51
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The point evaluator is a callback the caller supplies: it declares no state or resource.
52
+ */
53
+ evaluate(t: number): Point;
54
+ /**
55
+ * Evaluate mm/parameter^order. At a nonsmooth break, left/right requests
56
+ * select the exact incident chart's endpoint derivative; omission selects
57
+ * the caller's ordinary point value and makes no one-sided promise.
58
+ *
59
+ * @evidence contracts/development/common.md#meaningful-documentation States the derivative's unit per order, the one-sided selection at a break and what omitting the side promises.
60
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation The derivative evaluator is a callback the caller supplies: no method is implemented under this signature.
61
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure The derivative evaluator is a callback the caller supplies: its structure is the source chart's own.
62
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts The derivative evaluator is a callback the caller supplies: exactness at breaks is demanded of it, not implemented here.
63
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms The derivative evaluator is a callback the caller supplies: the cost of each order is the source chart's.
64
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The derivative evaluator is a callback the caller supplies: Ahn and Ghosh cache its jets themselves.
65
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The derivative evaluator is a callback the caller supplies: the signature holds no state between orders or sides.
66
+ */
67
+ derivative(t: number, order: 1 | 2 | 3 | 4 | 5, side?: "left" | "right"): Point;
68
+ }
69
+ /**
70
+ * Physical fit tolerance and explicit work limits, with no implicit defaults.
71
+ *
72
+ * @evidence contracts/development/common.md#meaningful-documentation Distinguishes physical tolerance from arc and subdivision budgets.
73
+ * @evidence contracts/development/design.md#principled-representation Positive finite tolerance and positive integer budgets require admission; reaching a budget returns partial evidence.
74
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The caller supplies the three controls needed to bound adaptive approximation.
75
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No specimen-dependent preset or hidden quality option is exposed.
76
+ */
77
+ interface IOptions {
78
+ /** Requested sampled geometric tolerance, in millimetres. */
79
+ toleranceMm: number;
80
+ /** Maximum accepted and unresolved leaf intervals in the resulting net. */
81
+ maximumArcs: number;
82
+ /** Maximum bisection depth per supplied source interval. */
83
+ maximumDepth: number;
84
+ }
85
+ /**
86
+ * One positive-weight rational quadratic over an original source interval.
87
+ * Its parameter runs independently from zero to one; domain only registers
88
+ * the source interval, since a fitted conic need not retain source speed.
89
+ *
90
+ * @evidence contracts/development/common.md#meaningful-documentation States normalized conic parameter, source registration and sampled error meaning.
91
+ * @evidence contracts/development/design.md#principled-representation Three planar controls and one positive middle weight encode exactly a rational quadratic, including explicitly admitted straight lines.
92
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Reconstruction consumes these coefficients without source geometry or a parallel curve representation.
93
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No dense source samples or original topology is retained in the result.
94
+ */
95
+ interface IArc {
96
+ /** Source interval represented by this coefficient record. */
97
+ domain: readonly [number, number];
98
+ /** Endpoint, tangent intersection, endpoint in the same millimetre frame. */
99
+ controls: readonly [Point, Point, Point];
100
+ /** Positive finite middle weight; endpoint weights are exactly one. */
101
+ weight: number;
102
+ /** Largest sampled geometric discrepancy, not a certified supremum. */
103
+ maximumSampleErrorMm: number;
104
+ }
105
+ /**
106
+ * Fitted coefficients and explicit limits of the supporting evidence.
107
+ * Partial results may omit unresolved intervals and must not be mistaken for
108
+ * a complete reconstruction; refused results have no admitted coefficients.
109
+ *
110
+ * @evidence contracts/development/common.md#meaningful-documentation Defines status, omission, certification and query accounting.
111
+ * @evidence contracts/development/design.md#principled-representation The closed status union separates complete, limited and refused operations; runtime logic owns consistency with coefficients.
112
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Both experiments report their coefficients and limitations through one recovery result owner.
113
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts Diagnostics preserve unsupported premises rather than hiding them behind an empty successful fit.
114
+ */
115
+ interface IResult {
116
+ /** Honest algorithm/provenance label, including adaptation where applicable. */
117
+ method: string;
118
+ /** Completeness of admitted source coverage. */
119
+ status: "complete" | "partial" | "refused";
120
+ /** Ordered coefficients; no source samples are retained. */
121
+ arcs: readonly IArc[];
122
+ /** Admission failures, approximation limits and provenance qualifications. */
123
+ diagnostics: readonly string[];
124
+ /** Maximum of accepted arcs' sampled error; zero for an empty result. */
125
+ maximumSampleErrorMm: number;
126
+ /** True only with a proven continuous error bound, never mere sampling. */
127
+ certified: boolean;
128
+ /** Number of source evaluate/derivative callback invocations. */
129
+ queries: number;
130
+ }
131
+ /**
132
+ * Isolated numerical source-cubic critical candidates on normalized (0,1).
133
+ * D=0 includes inflections and stationary points; categories may overlap.
134
+ * No endpoint or unresolved continuum is fabricated as an isolated root.
135
+ *
136
+ * @evidence contracts/development/common.md#meaningful-documentation Defines normalized parameters, overlapping categories, degeneracy and numerical limitations.
137
+ * @evidence contracts/development/design.md#principled-representation Readonly parameter arrays separate zero curvature numerator, affine extrema and velocity zeros; finite interior admission belongs to the polynomial-root owner.
138
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Both conic algorithms and the cubic source adapter share Recovery's critical-event result, with no reference-artifact dependency.
139
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No sampled data, specimen option or presumed future critical-event vocabulary is exposed.
140
+ */
141
+ interface ICubicCriticalParameters {
142
+ /** Sorted exact-value union of the three numerical candidate arrays. */
143
+ breaks: readonly number[];
144
+ /** Interior roots of cross(p',p''); not necessarily regular inflections. */
145
+ zeroCurvature: readonly number[];
146
+ /** Interior roots of the affine-curvature critical equations where defined. */
147
+ affineCritical: readonly number[];
148
+ /** Interior velocity common-root candidates, checked in both coordinates. */
149
+ stationary: readonly number[];
150
+ /** Computed curvature-numerator polynomial is identically zero. */
151
+ collinear: boolean;
152
+ /** Degenerate continua and finite arithmetic/root-observation limitations. */
153
+ diagnostics: readonly string[];
154
+ }
155
+ /**
156
+ * Observe cubic critical parameters without changing its points or jets.
157
+ * The four planar Bernstein controls define normalized t in [0,1]; the caller
158
+ * maps interior candidates to its source chart and reports unrepresentable
159
+ * mapped intervals. Close distinct roots are not merged by an epsilon.
160
+ *
161
+ * @evidence contracts/development/common.md#meaningful-documentation States coefficient basis, normalized parameter, caller mapping responsibility and unaltered source semantics.
162
+ * @evidence contracts/development/implementation.md#principled-implementation The coefficient helper differentiates the source cubic and delegates D=0, affine critical and stationary candidates to the existing engine polynomial-root owner.
163
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This namespace entry exposes one shared numerical owner to the two algorithms and their actual input adapter.
164
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No finite-difference endpoint movement, source samples or epsilon root merging is introduced.
165
+ * @evidence contracts/development/implementation.md#efficient-algorithms Fixed degree-two equations give bounded work independent of any mesh or source curve count.
166
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The returned classification is reusable by both methods for the same admitted coefficients.
167
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The pure wrapper retains no controls, callbacks or external resources.
168
+ */
169
+ function cubicCriticalParameters(controls: readonly [Point, Point, Point, Point]): ICubicCriticalParameters;
170
+ /**
171
+ * Evaluate positive-weight rational Bernstein coefficients on [0,1].
172
+ *
173
+ * @evidence contracts/development/common.md#meaningful-documentation Gives parameter range and assumes an admitted finite coefficient record.
174
+ * @evidence contracts/development/implementation.md#principled-implementation The quadratic Bernstein quotient is the standard rational conic representation with endpoint weights one.
175
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One shared evaluation prevents basis differences between fitting and reconstruction.
176
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source samples, weight correction or specimen branch changes the coefficients.
177
+ * @evidence contracts/development/implementation.md#efficient-algorithms Constant arithmetic and one output tuple are independent of source complexity.
178
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Bernstein factors and denominator are calculated once per evaluation.
179
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The pure call retains no input or resources after return.
180
+ */
181
+ function evaluate(arc: IArc, u: number): Point;
182
+ /**
183
+ * Euclidean separation in millimetres between two same-frame points.
184
+ *
185
+ * @evidence contracts/development/common.md#meaningful-documentation States the returned physical unit and same-frame premise.
186
+ * @evidence contracts/development/implementation.md#principled-implementation Math.hypot computes the Euclidean norm of the coordinate difference.
187
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Shared scalar geometry has no fitting or I/O responsibility.
188
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No rounding, clamping or specimen constants alter the distance.
189
+ * @evidence contracts/development/implementation.md#efficient-algorithms Constant arithmetic requires no retained storage.
190
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each coordinate difference is evaluated once.
191
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No resources or state survive the call.
192
+ */
193
+ function distance(a: Point, b: Point): number;
194
+ /**
195
+ * Signed planar determinant, used for orientation and tangent intersection.
196
+ *
197
+ * @evidence contracts/development/common.md#meaningful-documentation States the signed determinant and its geometric consumers.
198
+ * @evidence contracts/development/implementation.md#principled-implementation The 2-by-2 determinant measures oriented parallelogram area.
199
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Both algorithms share the primitive without a solver dependency.
200
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No tolerance or absolute value erases orientation.
201
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two products and one subtraction have constant cost.
202
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work No repeated source work is performed by this arithmetic helper.
203
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The call owns no retained state or external handle.
204
+ */
205
+ function cross(a: Point, b: Point): number;
206
+ /**
207
+ * Admit a finite source chart and positive explicit numerical budgets.
208
+ *
209
+ * @evidence contracts/development/common.md#meaningful-documentation Lists invalid-domain, boundary and budget effects; callbacks are checked when queried.
210
+ * @evidence contracts/development/implementation.md#principled-implementation Finite interval and budget checks establish the adaptive subdivision preconditions.
211
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Common admission owns structural checks; each paper owns differential premises.
212
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Invalid options produce diagnostics without defaults, clamping or callback invocation.
213
+ * @evidence contracts/development/implementation.md#efficient-algorithms Admission scans B source breaks once, using O(B) diagnostic storage only on failure.
214
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Callers validate once before fitting their intervals.
215
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No callbacks, source arrays or process resources are retained.
216
+ */
217
+ function validate(curve: ICurve, options: IOptions): string[];
218
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AutoMovieRecoveryConicApproximation = void 0;
4
+ const findAutoMovieRecoveryCubicCriticalParameters_1 = require("./findAutoMovieRecoveryCubicCriticalParameters");
5
+ /**
6
+ * Shared planar, millimetre-valued contract for experimental conic recovery.
7
+ * Rational quadratics use endpoint weights one and a positive middle weight;
8
+ * a collinear control triple with weight one is the admitted line primitive.
9
+ * The contract does not imply a Hausdorff certificate or a globally minimal net.
10
+ *
11
+ * @evidence contracts/development/common.md#meaningful-documentation States units, coefficient normalization, line representation and the limits of reported evidence.
12
+ * @evidence contracts/development/design.md#principled-representation Readonly planar tuples and explicit domains represent source charts and conic coefficients; finite values, positive weights and ordered domains require runtime admission.
13
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Recovery owns the shared contract consumed by the two paper experiments and their reconstruction caller.
14
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No specimen, source artifact, rendering option or optional algorithm-specific state enters this planar contract.
15
+ */
16
+ var AutoMovieRecoveryConicApproximation;
17
+ (function (AutoMovieRecoveryConicApproximation) {
18
+ /**
19
+ * Observe cubic critical parameters without changing its points or jets.
20
+ * The four planar Bernstein controls define normalized t in [0,1]; the caller
21
+ * maps interior candidates to its source chart and reports unrepresentable
22
+ * mapped intervals. Close distinct roots are not merged by an epsilon.
23
+ *
24
+ * @evidence contracts/development/common.md#meaningful-documentation States coefficient basis, normalized parameter, caller mapping responsibility and unaltered source semantics.
25
+ * @evidence contracts/development/implementation.md#principled-implementation The coefficient helper differentiates the source cubic and delegates D=0, affine critical and stationary candidates to the existing engine polynomial-root owner.
26
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This namespace entry exposes one shared numerical owner to the two algorithms and their actual input adapter.
27
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No finite-difference endpoint movement, source samples or epsilon root merging is introduced.
28
+ * @evidence contracts/development/implementation.md#efficient-algorithms Fixed degree-two equations give bounded work independent of any mesh or source curve count.
29
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The returned classification is reusable by both methods for the same admitted coefficients.
30
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The pure wrapper retains no controls, callbacks or external resources.
31
+ */
32
+ function cubicCriticalParameters(controls) {
33
+ return (0, findAutoMovieRecoveryCubicCriticalParameters_1.findAutoMovieRecoveryCubicCriticalParameters)(controls);
34
+ }
35
+ AutoMovieRecoveryConicApproximation.cubicCriticalParameters = cubicCriticalParameters;
36
+ /**
37
+ * Evaluate positive-weight rational Bernstein coefficients on [0,1].
38
+ *
39
+ * @evidence contracts/development/common.md#meaningful-documentation Gives parameter range and assumes an admitted finite coefficient record.
40
+ * @evidence contracts/development/implementation.md#principled-implementation The quadratic Bernstein quotient is the standard rational conic representation with endpoint weights one.
41
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One shared evaluation prevents basis differences between fitting and reconstruction.
42
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No source samples, weight correction or specimen branch changes the coefficients.
43
+ * @evidence contracts/development/implementation.md#efficient-algorithms Constant arithmetic and one output tuple are independent of source complexity.
44
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Bernstein factors and denominator are calculated once per evaluation.
45
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The pure call retains no input or resources after return.
46
+ */
47
+ function evaluate(arc, u) {
48
+ const a = (1 - u) ** 2;
49
+ const b = 2 * arc.weight * u * (1 - u);
50
+ const c = u * u;
51
+ const denominator = a + b + c;
52
+ return [
53
+ (a * arc.controls[0][0] + b * arc.controls[1][0] + c * arc.controls[2][0]) / denominator,
54
+ (a * arc.controls[0][1] + b * arc.controls[1][1] + c * arc.controls[2][1]) / denominator,
55
+ ];
56
+ }
57
+ AutoMovieRecoveryConicApproximation.evaluate = evaluate;
58
+ /**
59
+ * Euclidean separation in millimetres between two same-frame points.
60
+ *
61
+ * @evidence contracts/development/common.md#meaningful-documentation States the returned physical unit and same-frame premise.
62
+ * @evidence contracts/development/implementation.md#principled-implementation Math.hypot computes the Euclidean norm of the coordinate difference.
63
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Shared scalar geometry has no fitting or I/O responsibility.
64
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No rounding, clamping or specimen constants alter the distance.
65
+ * @evidence contracts/development/implementation.md#efficient-algorithms Constant arithmetic requires no retained storage.
66
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each coordinate difference is evaluated once.
67
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No resources or state survive the call.
68
+ */
69
+ function distance(a, b) {
70
+ return Math.hypot(a[0] - b[0], a[1] - b[1]);
71
+ }
72
+ AutoMovieRecoveryConicApproximation.distance = distance;
73
+ /**
74
+ * Signed planar determinant, used for orientation and tangent intersection.
75
+ *
76
+ * @evidence contracts/development/common.md#meaningful-documentation States the signed determinant and its geometric consumers.
77
+ * @evidence contracts/development/implementation.md#principled-implementation The 2-by-2 determinant measures oriented parallelogram area.
78
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Both algorithms share the primitive without a solver dependency.
79
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No tolerance or absolute value erases orientation.
80
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two products and one subtraction have constant cost.
81
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work No repeated source work is performed by this arithmetic helper.
82
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The call owns no retained state or external handle.
83
+ */
84
+ function cross(a, b) {
85
+ return a[0] * b[1] - a[1] * b[0];
86
+ }
87
+ AutoMovieRecoveryConicApproximation.cross = cross;
88
+ /**
89
+ * Admit a finite source chart and positive explicit numerical budgets.
90
+ *
91
+ * @evidence contracts/development/common.md#meaningful-documentation Lists invalid-domain, boundary and budget effects; callbacks are checked when queried.
92
+ * @evidence contracts/development/implementation.md#principled-implementation Finite interval and budget checks establish the adaptive subdivision preconditions.
93
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Common admission owns structural checks; each paper owns differential premises.
94
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Invalid options produce diagnostics without defaults, clamping or callback invocation.
95
+ * @evidence contracts/development/implementation.md#efficient-algorithms Admission scans B source breaks once, using O(B) diagnostic storage only on failure.
96
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Callers validate once before fitting their intervals.
97
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No callbacks, source arrays or process resources are retained.
98
+ */
99
+ function validate(curve, options) {
100
+ const errors = [];
101
+ if (!Number.isFinite(curve.domain[0]) || !Number.isFinite(curve.domain[1]) || curve.domain[0] >= curve.domain[1])
102
+ errors.push("Source domain must be finite and strictly increasing.");
103
+ if (curve.breaks.some((t) => !Number.isFinite(t) || t <= curve.domain[0] || t >= curve.domain[1]))
104
+ errors.push("Every supplied break must be finite and strictly inside the source domain.");
105
+ if (!Number.isFinite(options.toleranceMm) || options.toleranceMm <= 0)
106
+ errors.push("toleranceMm must be finite and positive.");
107
+ if (!Number.isSafeInteger(options.maximumArcs) || options.maximumArcs < 1 || !Number.isSafeInteger(options.maximumDepth) || options.maximumDepth < 1 || options.maximumDepth > 52)
108
+ errors.push("Budgets must be positive safe integers; maximumDepth must not exceed binary64's 52-bit subdivision precision.");
109
+ return errors;
110
+ }
111
+ AutoMovieRecoveryConicApproximation.validate = validate;
112
+ })(AutoMovieRecoveryConicApproximation || (exports.AutoMovieRecoveryConicApproximation = AutoMovieRecoveryConicApproximation = {}));
113
+ //# sourceMappingURL=AutoMovieRecoveryConicApproximation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoMovieRecoveryConicApproximation.js","sourceRoot":"","sources":["../../src/curves/AutoMovieRecoveryConicApproximation.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,30 @@
1
+ import { AutoMovieRecoveryCompactApproximation as C } from "./AutoMovieRecoveryCompactApproximation";
2
+ /**
3
+ * Refit whole smooth charts with storage-selected degree-three to degree-five
4
+ * Bernstein pieces and optional positive bitangent conics. Old source knots
5
+ * inform observation coverage but do not force output pieces.
6
+ *
7
+ * This is a degree-bounded adaptation of Schneider's endpoint-tangent fitting
8
+ * and adaptive subdivision (Graphics Gems, 1990), not a reproduction of a
9
+ * global minimum-control theorem. The existing engine's original-design Jacobi
10
+ * SVD replaces two-handle normal equations and extends the interior controls:
11
+ * https://github.com/erich666/GraphicsGems/blob/master/gems/FitCurves.c
12
+ * https://www.netlib.org/lapack/lapack_routine/dgesvj.f
13
+ *
14
+ * Every polynomial fixes endpoint positions and forward tangent directions.
15
+ * Trapezoid-weighted fitting nodes and distinct held-out quarter nodes inspect
16
+ * every supplied source knot interval. Polynomial paired-point distances give
17
+ * bidirectional geometric witnesses at those nodes, not a continuous bound.
18
+ * Conics additionally use independent source-apex radial correspondences in
19
+ * both directions. Finite samples cannot certify missed features, embedding,
20
+ * Hausdorff error or likeness. No source observation is retained in the result.
21
+ *
22
+ * @evidence contracts/development/common.md#meaningful-documentation States papers, adaptation, units, charts, hard corners, observation-only knots, sampling and incomplete-budget semantics.
23
+ * @evidence contracts/development/implementation.md#principled-implementation Endpoint-tangent least squares extends Schneider's construction to bounded degrees; original-design engine SVD avoids squared conditioning. Adaptive subdivision and independent-node distances admit candidates under explicit sampled premises.
24
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Call-local observation, candidate fit, verification and subdivision own separate steps; existing engine algebra and Ahn conic fitting retain their numerical responsibilities.
25
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No degree elevation, source mesh, specimen table, tolerance relaxation, numerical ridge or fabricated missing interval supplies output. Negative handles and unresolved numerical rank refuse their candidate.
26
+ * @evidence contracts/development/implementation.md#efficient-algorithms With N supplied source supports, L visited leaves and Q permitted callbacks, fixed degree at most five bounds each design width by six. Balanced subdivision observes O(N log L) nodes; binary searches restrict each support scan to its interval. Callback, leaf and depth budgets bound retained work; no global optimality or unmeasured speedup is claimed.
27
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Exact-parameter source points are snapshotted once and reused across degrees, fitting and verification; one candidate SVD solves every unknown on its original weighted design.
28
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources At most maximumQueries cached observations and maximumPieces leaves survive within the synchronous call. Only compact coefficients and scalar evidence escape; no callback or process is retained.
29
+ */
30
+ export declare function approximateAutoMovieRecoveryCompactCurves(curve: C.ICurve, options: C.IOptions): C.IResult;