docs(engines): template on shared services and a determinism rule
New engines start from the shared test kit (the template's tests are a one-line EngineContractTests subclass) and the host APIs, so they don't re-derive geometry reading, work areas or validator tolerances. BENCH-RULES.md now forbids clocks, unseeded randomness and environment variables from influencing placement (budgets count work; wall time only through the host's cancellation token) and lists the kit as read-only. Build-Engines.ps1 deploys only OpenNest.Engine.* folders, and New-Engine.ps1 -IncludeBuildFiles copies the kit. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-4
@@ -18,6 +18,10 @@ real-part drawing archive, tests and your final report.
|
||||
|
||||
Reuse is encouraged. These are tools you drive, composed by your own decision logic:
|
||||
|
||||
- `OpenNest.Engine.Jobs`: `JobPartGeometry`, stock `WorkArea`/`Area`/`Fits`,
|
||||
`RotationPolicy.EnumerateAngles`, `RotationCandidates`, `NestJobCost`, `NestTolerances`,
|
||||
`NestLayoutCheck`, and `NestJobResultBuilder`. These prepare geometry, check and account
|
||||
for decisions made by your algorithm; they do not choose placements.
|
||||
- `OpenNest.Core` geometry: `Polygon`, `Shape`, `BoundingBox`, `Vector`, `Box`, `ConvexHull`,
|
||||
`ConvexDecomposition`, `RotatingCalipers`, `Collision`, `NoFitPolygon`, `ShapeProfile`,
|
||||
`SpatialQuery`.
|
||||
@@ -46,10 +50,12 @@ measured numbers) so it can be generalized and upstreamed for every engine later
|
||||
|
||||
## Tests
|
||||
|
||||
`tests/` holds starter acceptance tests. Every layout is checked by the benchmark's own
|
||||
`NestValidator` (bounds, spacing, quantities, stock, rotation), so a passing test means the
|
||||
benchmark will accept the layout. They fail until `Solve()` is implemented. Keep them and
|
||||
add engine-specific tests next to them.
|
||||
`tests/` references the read-only `../Engine.Testing` kit and subclasses
|
||||
`EngineContractTests<TEngine>`. `LayoutAssert.Valid` uses `NestLayoutCheck.Violations`,
|
||||
the benchmark's shared validation primitive, plus strict bounds and accounting checks.
|
||||
The acceptance tests fail until `Solve()` is implemented. Keep them and add engine-specific
|
||||
tests next to them. No clocks, unseeded randomness or environment variables may influence
|
||||
placement; count work for budgets and honor the host cancellation token for wall time.
|
||||
|
||||
```bash
|
||||
dotnet test OpenNest.Engine.__NAME__/tests/OpenNest.Engine.__NAME__.Tests.csproj
|
||||
|
||||
Reference in New Issue
Block a user