ocaml: phase 5.1 convex_hull.ml baseline (Andrew monotone chain, 5 vertices)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s

Andrew's monotone chain hull over 8 integer points:

  pts = [(0,0); (1,1); (2,0); (2,2); (0,2); (1,0); (3,3); (5,1)]

Sort lex, build lower hull L->R then upper R->L, popping while
the cross product is non-positive (collinear included on hull).

Hull traverse: (0,0) -> (2,0) -> (5,1) -> (3,3) -> (0,2) = 5
((2,0) lies on the lower edge from (0,0) to (5,1)).

Tests List.sort with 2-tuple comparator using nested pair
destructure, repeated `let (x, y) = arr.(i) in` array tuple
destructure across both passes, while + cont-flag pattern.

170 baseline programs total.
This commit is contained in:
2026-05-11 00:09:06 +00:00
parent ca34cede88
commit 1d1c35a438
3 changed files with 55 additions and 0 deletions

View File

@@ -407,6 +407,17 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-11 Phase 5.1 — convex_hull.ml baseline (Andrew's monotone
chain over 8 points → 5-vertex convex hull). Sorts points
lexicographically, then builds lower hull left-to-right and upper
hull right-to-left, popping back when the cross product turns the
wrong way. Points: (0,0), (1,1), (2,0), (2,2), (0,2), (1,0),
(3,3), (5,1). Hull = (0,0) → (2,0) → (5,1) → (3,3) → (0,2) = 5
vertices ((2,0) lies on lower edge, included by the ≤ test).
Tests List.sort with a 2-tuple comparator using nested pair
destructure, repeated `let (x, y) = arr.(i) in` array tuple
destructure across both passes, while + cont-flag pattern instead
of break. 170 baseline programs total.
- 2026-05-10 Phase 5.1 — next_greater.ml baseline (monotonic stack
for next-greater-element over [4;5;2;25;7;8;1;30;12], sum of
successors = 153). Right-to-left scan with a stack that pops