Davis Geometric
← Bee’s notebook

Experiments & connections

End is not done.

Did the machine actually finish the cut or just stop?

I started with CNC Mill Tool Wear, a set of 18 experiments from the University of Michigan’s SMART Lab. Kaggle is a site where people share datasets and run competitions. This is a public dataset, not a Kaggle competition.

The researchers suggested two things to look for in the records: wear on the cutting tool, and whether the clamp held the wax firmly enough. I wanted to answer a smaller question first: What work did the log actually record before it said End? Every one of the 18 logs ends with that word, even the unfinished ones.

Picture the cut.

A CNC mill is a computer-controlled cutting machine. In these experiments the mill was set up to carve an S in a block of wax in three layers. Each layer takes two trips along the cut, labeled Up and Down in the log. Each trip is one pass.

I used GIGI, my database, to compare the recorded sequence with the plan. Did the log record all six passes in the right order before End? Only afterward did I compare the audit with the researchers’ separate record of which runs finished.

Real CNC logs / An ordered completion audit

Both say End. Did both finish?

Run 02 and Run 07 both used wax. The tool was set to travel along the cut at 20 mm/s, and the clamp holding the wax was set to 4 bar. Compare the two runs to see what made it into the log.

The dataset labels one tool worn and the other unworn. This comparison does not establish why one run stopped early.

Recorded reference: Run 02 contains all six passes. Run 07 contains three; after Layer 2 Up at rows 506–544, End starts at row 545 where Layer 2 Down should come next.

The interactive audit runs when JavaScript and WebAssembly are available. The reference figure, source rows and full-series table below remain readable without them.

Stopping is not the same as finishing.

I don’t want a system to tell me the work is finished just because it stopped. I want it to show me what happened in between.

Run 07 makes the difference visible. Its last cutting block says Layer 2 Up, rows 506–544. At row 545, the log says End. There is no recorded Layer 2 Down, Layer 3 Up or Layer 3 Down. Those empty slots are the evidence; End by itself hides them.

Run 02 records all six required passes. Run 07 records only the first three. Both logs contain End.
Recorded comparison from the published stage labels. Solid teal slots have a recorded pass; dashed copper slots do not. This is a process-order diagram, not a reconstructed machine trajectory.
Read the source row ranges without running the demo

Run 02 · experiment_02.csv

Retained stage blocks in source order
StageData rows
StartSynthetic anchor
Layer 1 UpRows 175–386
Layer 1 DownRows 387–618
Layer 2 UpRows 872–1014
Layer 2 DownRows 1015–1218
Layer 3 UpRows 1366–1509
Layer 3 DownRows 1510–1643
EndRows 1644–1668

Run 07 · experiment_07.csv

Retained stage blocks in source order
StageData rows
StartSynthetic anchor
Layer 1 UpRows 52–246
Layer 1 DownRows 247–339
Layer 2 UpRows 506–544
EndRows 545–565

Start is a synthetic comparison anchor, not a measured operation. Original files and all retained row spans are linked below.

What improved in these 18 runs?

Only check for End14 / 18

Agreement with published completion labels. All logs contain End, so this rule accepts all four incomplete runs.

Check the ordered recipe18 / 18

Agreement on this same series. Runs 04, 05, 07 and 16 are identified as incomplete.

This comparison uses every run in the supplied series, with no exclusions. The ordered audit records its decisions before reading the completion outcomes. But the dataset and stage structure were inspected while designing the audit: this is a retrospective check, not a blinded test or a trained fault detector. It establishes a useful correction to an End-only rule, not superiority over other sequence-auditing methods.

Recorded replay of all 18 runs · published outcomes shown separately
RunPasses recordedEnd markerOrdered auditPublished completionVisual inspection
016 / 6PresentCompleteCompletedPassed
026 / 6PresentCompleteCompletedPassed
036 / 6PresentCompleteCompletedPassed
041 / 6PresentIncompleteIncompleteNot reported
051 / 6PresentIncompleteIncompleteNot reported
066 / 6PresentCompleteCompletedFailed
073 / 6PresentIncompleteIncompleteNot reported
086 / 6PresentCompleteCompletedFailed
096 / 6PresentCompleteCompletedFailed
106 / 6PresentCompleteCompletedFailed
116 / 6PresentCompleteCompletedPassed
126 / 6PresentCompleteCompletedPassed
136 / 6PresentCompleteCompletedPassed
146 / 6PresentCompleteCompletedPassed
156 / 6PresentCompleteCompletedPassed
162 / 6PresentIncompleteIncompleteNot reported
176 / 6PresentCompleteCompletedPassed
186 / 6PresentCompleteCompletedPassed

Four logs with every required pass—06, 08, 09 and 10—have a failed visual-inspection label. That is a different question. A complete log is not proof of a usable part, correct physical motion or safe machine operation. The audit reads the supplied stage labels; it does not independently validate those labels against the sensors.

Why the order matters.

A checklist of names is not enough either. Swapping two passes preserves their count and both endpoints, but changes the recipe. The verification includes a deliberately swapped sequence, a missing pass and a repeated pass. They must all fail; the complete recipe must pass.

This uses the same GIGI comparison kernel as Close endpoints. Different route., with a different measurement contract. There, the coordinates are recorded hand positions. Here, they are symbols for layer and direction. We ask for an exact match of the ordered stages, not closeness of a physical route.

The mathematical rule, one layer down

The categorical chart is Start = (0,0), Layer k Up = (k,1), Layer k Down = (k,−1), and End = (4,0). Distinct stages get distinct points. These coordinates do not describe positions in the mill. The clock is ordinal pass index, not seconds.

Discrete Fréchet comparison pairs the two lists in order while covering every point on both. Zero separation requires identical symbols at every pairing. After consecutive equal stage labels are collapsed, distance zero is equivalent to the same ordered stage sequence. Nonconsecutive repeats are retained; ambiguous separated blocks of the same pass are refused.

The wrapper accepts only a discrete interval exactly [0,0], rejects an interval with a strictly positive lower bound, and otherwise returns unresolved. It does not use the kernel’s continuous-polyline verdict for this symbolic audit. Run 02 has discrete distance zero; Run 07’s numerical interval encloses √2. The interval’s size is not a fault-severity score.

An ordinary ordered-list comparison can express this acceptance rule too. GIGI contributes an implementation with a declared chart, ordered alignment and inspectable witness. The wrapper translates that result into stage names and the first disagreement. Discrete Fréchet distance is credited to Thomas Eiter and Heikki Mannila, Computing Discrete Fréchet Distance (1994).

Where this could help.

A final status can be useful without being sufficient. For a workflow with an explicit recipe, retaining the ordered steps lets an auditor ask a stronger question: show me that the required sequence was recorded, and point to the first departure when it wasn’t.

That could support process audits where a terminal marker is being treated as completion. Applying it elsewhere would require that system’s own recipe, trusted stage labels and tests. Detecting an unlabelled physical fault from raw measurements remains a separate task.

Data, method and verification

For a browser replay, load the published wrapper and WASM, call createCncAudit(binary, fixture), then engine.audit(run.stages). The native query is shown in the demo. The thin WASM build harness remains unpublished; asset parity is not independent build reproduction. No production GIGI API change is part of this example.