@@ -23,6 +23,32 @@ Those properties map directly to several current `csgrs` pain points: finite
2323coordinate enforcement, deterministic map/set keys, explicit NaN/infinity
2424policy, and centralized approximate comparisons.
2525
26+ ## Branch and commit discipline during the port
27+
28+ Porting work should happen on a branch named ` hyperreal ` in each repository
29+ touched by the migration. This applies especially to:
30+
31+ - ` csgrs `
32+ - ` spade `
33+ - ` boolmesh `
34+ - ` curvo `
35+ - ` voxelis `
36+
37+ The default branches should be treated as integration targets, not active
38+ porting branches. Before changing a repository for the port, switch that
39+ repository to its ` hyperreal ` branch or create it from the appropriate upstream
40+ base if it does not exist yet.
41+
42+ During the porting period, each successful change should be verified, committed,
43+ and pushed automatically to that repository's ` hyperreal ` branch before moving
44+ on to the next independent change. Cross-repo work should be split into
45+ repository-local commits so ` csgrs ` , ` spade ` , ` boolmesh ` , ` curvo ` , and ` voxelis `
46+ each retain a reviewable history of the port.
47+
48+ After every successful commit and push, take another implementation turn against
49+ the next incomplete item in this plan. Continue that cycle until the plan is
50+ finished, tests expose a blocker, or a design decision requires human review.
51+
2652## Target ownership model
2753
2854The stack should have clear vertical responsibilities:
@@ -40,12 +66,24 @@ csgrs = CSG objects, modeling operations, topology, metadata, IO, and us
4066
4167- exact rationals
4268- symbolic and computable reals
69+ - shared reduced expression machinery with symbolic leaves
70+ - standard-real solver variables and formal infinitesimal perturbation leaves
4371- lazy approximation
4472- sign, zero, magnitude, and structural facts
4573- refinement and conservative comparison support
4674
4775It should not own CSG, polygon, mesh, or CAD-specific geometry types.
4876
77+ The machinery needed for the feature that gives ` hyperreal ` its name should be
78+ developed together with the machinery needed to map a SolveSpace-style solver
79+ onto ` hyperreal ` , but the semantics should remain distinct. Both need reduced
80+ expression graphs, symbolic leaves, dependency sets, structural facts,
81+ derivative hooks, and cached evaluation. Solver variables are unknown standard
82+ reals that are bound by an evaluation context during iterative solving.
83+ Infinitesimal perturbations are ordered formal terms used for exact
84+ lexicographic signs, tie-breaking, degeneracy handling, and simulation of
85+ simplicity; they are not ordinary variables to solve for numerically.
86+
4987### ` hyperlattice `
5088
5189` hyperlattice ` should own the general linear algebra layer:
@@ -356,6 +394,36 @@ yet operate on the new numeric stack:
356394 runners, and any other non-` csgrs ` geometry implementation used during the
357395 port
358396
397+ External geometry kernels should be handled on their own ` hyperreal ` branches.
398+ In particular, ` spade ` , ` boolmesh ` , ` curvo ` , and ` voxelis ` should not receive
399+ long-running uncommitted local patches during the ` csgrs ` migration. A verified
400+ change in one of those libraries should be committed and pushed to that
401+ library's ` hyperreal ` branch before ` csgrs ` is updated to depend on it.
402+
403+ When a needed function is missing from ` hyperlattice ` , ` hyperlimit ` ,
404+ ` hypersolve ` , or a future ` hyperphysics ` crate, the normal path should be to
405+ borrow the algorithm from an appropriately licensed crate, port it to
406+ ` hyperreal ` -compatible scalar and fact machinery, and extend the correct stack
407+ crate here. Crates such as ` nalgebra ` are valid sources when their licenses,
408+ attribution requirements, and implementation boundaries are compatible with the
409+ target crate. The goal is not to keep permanent f64-only adapter islands; it is
410+ to move useful, well-understood algorithms into the ` hyperreal ` stack so they
411+ share consistency, structural facts, exact/perturbed predicate behavior, and
412+ performance work with the rest of the system.
413+
414+ Use this path for crates that should ultimately be ported to ` hyperreal ` for
415+ consistency and performance:
416+
417+ - linear algebra, transforms, decomposition, and dense/sparse numeric kernels
418+ belong in ` hyperlattice `
419+ - robust geometric predicates, carriers, classification helpers, and
420+ degeneracy policies belong in ` hyperlimit `
421+ - solver residual, Jacobian, rank, projection, and constraint scheduling
422+ helpers belong in ` hypersolve `
423+ - physical simulation, dynamics, collision-response policy, material behavior,
424+ or other non-geometric physics primitives should live in a separate
425+ ` hyperphysics ` crate if they do not fit the existing ownership boundaries
426+
359427Keep these adapters private at first. The first milestone is internal
360428correctness, not public API churn.
361429
@@ -569,6 +637,41 @@ At this point, the semantic boundary should already be correct:
569637The hyperreal port should therefore focus on backend behavior, performance, and
570638additional certificates rather than rewriting ` csgrs ` modeling logic again.
571639
640+ This phase should align with the ` hypersolve ` / SolveSpace-style symbolic
641+ variable work in ` hyperreal ` . The shared substrate should support:
642+
643+ - expression nodes with symbolic leaves
644+ - dependency and independence facts
645+ - structural sign, zero, magnitude, and domain facts before full evaluation
646+ - reduced-expression caching across repeated queries
647+ - derivative hooks for solver residuals and, where useful, perturbation
648+ propagation
649+ - bounded simplification so solver equations and infinitesimal series do not
650+ grow without control
651+
652+ The first infinitesimal target should be CAD-useful ordered perturbations, not a
653+ general nonstandard-analysis universe. A practical model is a finite
654+ lexicographic perturbation tower:
655+
656+ ``` text
657+ standard Real + a1*eps + a2*eps^2 + ...
658+ ```
659+
660+ or an equivalent ordered perturbation-term representation. ` hyperlimit ` should
661+ be able to use these terms to decide predicate signs in degenerate cases without
662+ inventing ad hoc epsilon constants. ` hypersolve ` should use the same expression
663+ and fact infrastructure for standard-real variables, residuals, Jacobians, and
664+ rank diagnostics. The two paths should share representation, reduction,
665+ caching, and derivative infrastructure while keeping their policy layers
666+ separate:
667+
668+ - solver symbols are bound by an evaluation context and participate in numeric
669+ iteration
670+ - infinitesimal symbols are ordered formal perturbations and participate in
671+ lexicographic comparison
672+ - ` csgrs ` consumes the resulting classifications and certificates, but still
673+ owns CSG topology, metadata, and modeling policy
674+
572675### Phase 10: Public API cleanup
573676
574677After internals are stable:
@@ -1818,6 +1921,13 @@ Show-off examples:
18181921
18191922## Design rules during the port
18201923
1924+ - Work on the ` hyperreal ` branch of each affected repository, especially
1925+ ` csgrs ` , ` spade ` , ` boolmesh ` , ` curvo ` , and ` voxelis ` .
1926+ - Commit and push each verified successful change to that repository's
1927+ ` hyperreal ` branch before starting the next independent change.
1928+ - After each successful commit and push, take another implementation turn on the
1929+ next unfinished porting-plan item, continuing until the plan is complete or a
1930+ blocker requires review.
18211931- Lower crates provide facts; ` csgrs ` makes modeling decisions.
18221932- Predicate uncertainty should be represented explicitly until ` csgrs ` decides
18231933 how to handle it.
0 commit comments