fullseye

Making general algorithms implementable — the algo-c support roadmap

日本語 · English · 简体中文 · 繁體中文 · 한국어 · Deutsch

User request (2026-08-16): make general algorithms like those in https://github.com/okumuralab/algo-c (Haruhiko Okumura, [Revised new edition] A Dictionary of Standard Algorithms in C, full source) implementable in Fullseye too.

An honest read of where we are: Fullseye is currently an image-algorithm design AI (an op registry of image/region/feature/contour/volume sorts; evolution + a holdout gate + Python→C codegen). General algorithms (sorting/searching/graphs/number theory/crypto/compression) do not ride on image sorts, so they need an extension of the language, types and codegen. This is multi-session work. This doc is its confirmed plan (the source of truth the next session executes with full context).

The categories of algo-c (the book’s TOC, a map of implementation targets)

※ The strict inventory is the repo’s /src as source of truth.

Field Representative algorithms Where it lands in Fullseye
Numerics equations (bisection/Newton), numerical integration (Simpson/Romberg), linear systems (Gauss/LU), interpolation (spline), FFT existing dsp (FFT) + a new numeric op family
RNG / statistics Mersenne Twister, distributions, statistics new rng/stat ops (deterministic seed)
Sorting quick/heap/merge/shell/radix a new array sort + a seq type
Searching binary search, hashing, BST/AVL/B-tree new array/map ops
Strings KMP/BM/Rabin-Karp, edit distance, regular expressions a new text type + ops
Graphs DFS/BFS, Dijkstra, Warshall-Floyd, MST, max flow a new graph type + ops
Geometry convex hull, segment intersection, Voronoi existing pcseg/geometry + a new geom2d
Number theory / crypto primes, GCD, RSA, MD5/SHA, AES new numtheory/crypto (educational, honest disclosure)
Compression Huffman, LZ/LZW, arithmetic coding a new compress op
DP / search 8-queens, knapsack, DP fscript’s control flow + array

Implementation architecture (confirmed policy)

Extend Fullseye’s existing assets to the general case. Do not dilute the focus on the image AI (general ops are a separate tier / opt-in).

  1. Type-system extension: to the current 6+1 sorts (image/region/feature/contour/match/any/ volume), add seq (1-D array) / text (string) / graph / scalar (the sorts in ops.py, the fslib types).
  2. Making fscript a general language: it already has if/for/while, assignment and tuples. Add array/string literals, indexing and procedures (functions) in stages (the current decision was to narrow the language scope, so the general tier is unlocked under a separate profile). Source of truth = revisit the A/B branch in docs/FSCRIPT_DECISION.md.
  3. Op-registry extension: register each algorithm of algo-c as an op (name/in-out sort/params/ c_stmt). Reuse the existing Python→C codegen (engine.to_python/to_c) + difftest (an honest gate: Python is the oracle, the C is differentially verified) as is → guarantee “it can be implemented in C” by actual measurement.
  4. honest gate: feed algo-c’s C to difftest as the reference implementation and verify the numeric/bit match with Fullseye codegen’s C (an extension of the existing gate). Respect the license of the original code (algo-c ships with the book; the terms of use need checking) and reimplement from the specification, not by copying verbatim (the public-disclosure policy).

The staged plan (from the next session onward)

Honest limits and discipline


P1 completion record (2026-08-16, Opus5[1m]/ultracode)

Achieved the minimal proof that “Fullseye can generate C for general algorithms too, and can measure the C match honestly”.

P1 hardening after adversarial review (2026-08-16, [[feedback_no_solo_ai_judgment]])

Carried out an independent adversarial review of this session’s own code (a Workflow of 4 lenses = algorithm correctness / codegen·C safety / gate soundness / integration·focus safety, 22 findings). I did first-hand code verification of every one (the v11 discipline) and fixed the true defects:

Next (P2 onward)

P3 completion record — string ops (2026-08-17, Opus5[1m]/ultracode, graph-loop-engineering)

Added 3 string algorithms to the algo tier. “A string = carry a codepoint sequence as float64” (a Unicode scalar is < 2^53 so it’s exact) so it rides the existing float64 binary harness unmodified (no new wire type). Values are compared only for equality (exact with integer codes); positions/distances are exact integers → C-vs-Python bit match, and Python-vs-oracle is EXACT (tol 0).

P3 string hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

The independent adversarial review Workflow (4 lenses; each finding confirmed by a verification agent against real code / a real compile) = 3 findings all CONFIRMED (2 of them report the same root cause from different lenses). After first-hand verification I fixed them all:

P2 completion record — gauss_solve (2026-08-16, Opus5[1m]/ultracode, graph-loop-engineering)

Added Gauss elimination for a linear system (partial pivoting), completing the P2 numerics. As the user instructed, made it a node in the raptor work-graph with the graph-loop-engineering skill and had a tool driver run it unattended (the two-layer policy = breadth is the work-graph’s difftest gate; the acceptance of adversarial findings and the push are the session’s human checkpoint).

P2 gauss hardening after adversarial review (2026-08-16, [[feedback_no_solo_ai_judgment]])

An independent adversarial review Workflow of the gauss code I wrote (4 lenses = numeric correctness / C safety / gate soundness / integration·coverage; each finding reproduced by running by a verification agent). Fixed all 4 CONFIRMED of 5 findings after first-hand code verification:

P1.5b completion record — showing the general tier read-only in Studio (2026-08-17, Opus5[1m]/ultracode)

Shows the general(algo) tier in the op browser. A design that doesn’t dilute the image focus = general ops are a separate compute model of seq/scalar, so read-only (can’t be put in an image pipeline).

P4 completion record — graph ops (2026-08-17, Opus5[1m]/ultracode, bonus)

Added 3 graph algorithms to the algo tier (out of the candidate set but a bonus in line with the user’s “proceed with all of it” + 7-8h of autonomy). Pack the graph into an input seq ([n, m, (u,v,w)*m], undirected; dijkstra prefixes src as [n, m, src, ...]) to ride the existing float64 harness.

P5 completion record — number theory, compression, educational hashing (2026-08-17, Opus5[1m]/ultracode, graph-loop-engineering)

Added 5 general algorithms to the algo tier, completing the algo-c roadmap (P1→P5). Carries integers as float64 (exact < 2^53) so no new wire type is needed. Bit/integer arithmetic is done C-side by casting to unsigned long long/unsigned int and back to double (the result is < 2^53 and exact). All 5 ops are exact (C == Python bit match, and Python == an independent oracle at tol 0).

P5 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

An independent adversarial review Workflow of the P5 code I wrote (4 lenses = algorithm-correctness / C-safety-codegen / gate-honesty / integration-focus; each finding reproduced by a real compile/run by a verification agent, 18 agents). 14 raw → 9 CONFIRMED / 5 REFUTED. After first-hand reproduction of every CONFIRMED (compiling/running with ziglang myself), I fixed them. Notable is the deep probe into “can the gate falsify my own guards”:

P6 completion record — computational geometry (2026-08-17, Opus5[1m]/ultracode, 12h autonomous, graph-loop-engineering)

Added 3 geometry algorithms to the algo tier (an extension after completing the algo-c roadmap P1→P5 = P6. Corresponds to the initial TOC’s “geometry = convex hull / segment intersection”). It is also a bridge to the image tier’s contour/region processing. Pack 2-D points into an input seq and, with integer coordinates (each in [-100000, 100000]), make every orientation test / shoelace sum an exact integer (no floating-point division at all) = C bit match, and Python == an independent oracle at tol 0.

P6 adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

Ran two independent adversarial review Workflows in parallel (each finding reproduced by a verification agent via real compile/run/stress):

P7 completion record — segment intersection (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Extended the geometry toolkit by 1 op: segments_intersect (KIND_REDUCE) = whether 2 closed segments [x1,y1,x2,y2,x3,y3,x4,y4] intersect (1.0/0.0). A bridge to the image’s line/contour analysis. CLRS 33.1’s integer orientation method (proper crossing = the endpoints strictly straddle the other’s line + 4 collinear on-segment special cases). With integer coordinates [-100000,100000] the cross product is exact (|cross| ≤ 8e10 fits in long long) = C bit match. oracle = sympy.geometry’s Segment intersection (symbolic computation = a wholly different method from orientation). Measured: 8 fixed cases correct + 0 mismatches vs sympy on 2970 random integer segment pairs (including collinear overlap/T-junction/shared endpoint/near-miss). Degenerate (point) segments are excluded from the holdout because sympy can’t make a Segment (the op works with the general orientation logic but is ungated = disclosed). difftest passed (python exact / C bit match / c_verified), work-graph node unattended done (all 24 algo ops gated).

P7 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 3-lens adversarial review (reproduced by a verification agent via real compile/run) = 1 raw → 1 CONFIRMED (MED, gate-honesty). The op itself is correct (fully agrees with sympy), but the difftest holdout never once drives the on-segment special cases of d1/d3/d4 (an endpoint lands inside the other segment, no shared endpoint) as the sole reason for a 1.0 verdict, so the gate passes a wrong op that drops that branch (not one of the 50 holdout verdicts changes). Confirmed by self-reproduction (a d3+d4-drop mutant is passed=True, [0,0,10,0,3,0,3,5]→0.0 wrong). Fix = added fixed holdout cases that make each on_seg branch (d1/d2/d3/d4) the sole reason (an endpoint inside the other, 4 axis-parallel + 2 diagonal) → self-confirmed that dropping any branch makes difftest FAIL (d1/d2/d3/d4 all passed=False). Added the 4 endpoint-inside cases to the known-solution test too. Whole suite 4765 → 4772 passed / 0 failed (+7), ruff clean, mypy new 0.

P8 completion record — search/selection (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Added 2 search/selection algorithms to the algo tier (moving from geometry to a different domain to even out the tiers). Comparison-based, handling any (NaN-free) double = the result is an index or an existing element so it’s exact (tol 0), C bit match.

P8 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 2-lens adversarial review (real compile/run verification) = 1 raw → 1 CONFIRMED (LOW, correctness). Correctness unchanged but a performance defect: kth_smallest’s quickselect is single-pivot Lomuto so it’s O(n²) on large all-equal/low-cardinality input (median-of-three doesn’t protect duplicates; n=40000 all-equal at 7.44s, sorted/reverse fast). The test didn’t catch it (holdout n≤30, the timing test on sorted only). The sibling quicksort already uses a 3-way (Dutch flag) partition. Fix = rewrote kth_smallest to a 3-way (Dutch national flag) partition (folds duplicates in the equal band → all-equal becomes O(n); comparison-only + order-independent so C == Python == sorted()[k] parity is preserved). Self-confirmed = all-equal n=40000 from 7.44s → 0.0019s (O(n)), correctness 5000 cases mism 0, difftest bit match. Extended the timing test to sorted/reverse/all_equal/few_distinct (actually guarding the regression).

P9 completion record — statistics/aggregation (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Added 2 statistics ops to the algo tier: count_distinct (the number of distinct values = an integer count) / mode_value (the mode, the smaller value wins a tie). Comparison-based (any NaN-free double), the result is a count or an existing element so it’s exact (tol 0). Both ops copy → sort → run-scan (the result is order-independent so C’s qsort and Python’s sorted differing is still a bit match). oracle = len(set()) / collections.Counter (independent mechanisms). ★proactive hardening: with a zero mode and mixed ±0.0, C’s unstable qsort and Python’s stable sort can make the return value’s sign diverge → a bit mismatch → canonicalize −0.0→+0.0 with + 0.0 (other values unchanged) to make C==Python robust (the same family as rle_encode’s signed-zero disclosure). Measured: 0 oracle mismatches on 5000 random cases each, difftest passed (python exact / C bit match / c_verified). All 28 algo ops gated. ruff clean, mypy new 0.

P9 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 2-lens adversarial review (real compile/run/mutation verification) = 1 raw → 1 CONFIRMED (MED, gate-safety). Correctness unchanged but a gate coverage gap: the holdout can’t falsify a mutant that drops mode_value’s +0.0 canonicalization (the sole signed-zero case [0.0,-0.0,0.0] sorts to +0.0-last in both backends → still a bit match even with canonicalization removed). The bit-check the comment claims as the guarantee never actually drives the canonicalization. Fix = added [0.0,-0.0], [-0.0,0.0] where -0.0 doesn’t come last in the run to the holdout (both orders = regardless of qsort tie order, one of them must diverge). Self-confirmed = a canonicalization-removal mutant makes difftest FAIL, the current (canonicalized) code passes the added cases as a bit match. Whole suite 4787 → 4796 passed / 0 failed.

P10 completion record — number theory (part 2) (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Added 2 number-theory ops (on top of P5’s integer machinery, sharing the numtheory category). Carries integers as float64 (exact <2^53); in the honest domain every modular product fits in uint64/long long = C bit match, and Python == an independent oracle at tol 0.

P10 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 2-lens adversarial review (real compile/run/mutation verification) = 1 raw → 1 CONFIRMED (MED, c-safety-gate). The op itself is correct and overflow-safe (verified on 353 adversarial cases), but modular_inverse’s holdout doesn’t drive the declared domain 2^53 (in-domain m stops around ~1e9), so a C long long→int width-narrowing mutant (which breaks the 2^53 domain) passes the gate as a bit match. The siblings pow_mod (pins base=exp=2^53) / gcd_seq (the 2^53 guard edge) / is_prime (near-2^32) catch the same kind of mutant, but only modular_inverse didn’t. Fix = added 2^53-edge cases ([2, 2^53−1] coprime→inverse, large coprime near 2^53, [2^52, 2^53] both even→−1) to the holdout (the Bezout arithmetic drives |q·s|~2m~2^54). Self-confirmed = the long long→int mutant makes difftest FAIL, the baseline passes as a bit match. The oracle (pow) already covered it so only the holdout was added. Whole suite green.

P11 completion record — bit manipulation (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Added 2 bit-manipulation ops: xor_reduce (the bitwise XOR of all elements) / popcount_total (the total count of 1 bits over all elements = Kernighan). Carries non-negative integers as float64; in the domain [0, 2^53−1] every value fits in 53 bits (the XOR result is also < 2^53 = exact; popcount is a small integer) = C bit match, and Python == an independent oracle (functools.reduce(operator.xor) / builtin int.bit_count() = a different mechanism from Kernighan) at tol 0. Both ops passed=True, python exact / C bit match / c_verified. Measured 0 oracle mismatches on 3000 random cases each beforehand. fail-soft = negative/non-integer/≥2^53 → 0.0. All 32 algo ops gated. ruff clean (FURB161 changed bin().count('1').bit_count()), mypy new 0.

P11 adversarial review result (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 2-lens adversarial review Workflow (correctness + gate-safety, wf_7d130631-c0f) = 0 findings (no defects). Reviewer 1 returned {findings:[]}; reviewer 2 was interrupted by a window compaction mid “gate mutation testing (break the implementation and see if the gate catches it)” (produced no result). Following the discipline, I did not revive the dead background but completed the same mutation test by first-hand verification: ran 7 representative mutants for xor_reduce/popcount_total (empty init acc=1 / OR misuse / a 2^53-domain-boundary off-by-one / negative-guard removal / Kernighan→shift [popcount≠bitlength] / a +2 error / admitting 2^53) against the holdout → the independent oracle catches all 7 mutants (oracle_err > 0). Conclusion = the P11 gate is falsifying, no confirmed defect (fed093a is sound, no follow-up commit needed).

P12 completion record — the extended Euclidean algorithm (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Added 1 number-theory op (on top of P5’s integer machinery + P10’s Bezout invariant, sharing the numtheory category = P5+P10+P12). extended_gcd (KIND_MAP): input [a, b] (non-negative integers ≤ 2^53) → output [g, x, y] (exactly 3 values, a·x + b·y = g = gcd(a,b)), out of domain is [] fail-soft. Computes the coefficients by an iterative two-variable sweep. The coefficients are exact (the invariant |q·s| = |old_s − new_s| ≤ 2·max(a,b) ≤ 2^54 fits in the C long long) so C == Python bit match. The domain is [0, 2^53] inclusive (2^53 is exact; the coefficients |x|,|y| ≲ 2^52 are also exact in float64).

P12 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 3-lens adversarial review Workflow (correctness / c-safety+gate-honesty / integration; each finding reproduced by a real compile/run mutation by a verification agent, 5 agents, 125 tool uses) = 2 raw (same root cause) → 1 CONFIRMED (MED, gate-cannot-falsify). The op itself is correct (verified on 200k + all ends, non-divergent vs the recursive oracle, no long long overflow in-domain), but all of difftest’s out-of-domain cases are on operand a ([2^53+2,3]/[2.5,7]/[-1,7]), and the sole bad-b case [7,NaN] has NaN short-circuit at bd>=0.0 and never drives any of b’s 3 guard clauses alone → a one-sided regression of the b-side guard (plausible since a/b are copy-paste symmetric) passes both gate halves (the same gate-coverage lesson as P5/P7/P9/P10). Confirmed by self-reproduction: removing bd>=0 / bd<=2^53 / bd==int from both _PY/_C → all passed=True (MISSED), the symmetric a-side removal is all passed=False (CAUGHT, because a’s domain ends are in the holdout). Fix = added [valid_a, finite_bad_b] cases ([3, 2^53+2], [7,-1], [7,2.5]) to the holdout and the fail-soft test → on re-measurement the 3 b-side removals are all CAUGHT (passed=False, pydiff=inf), the baseline is a bit match pass on 70 cases. ★Adopted the verification agent’s honest correction (rejecting the finding’s overclaim): “removing bd<=2^53 is C long long overflow UB at b=2^62” is inaccurate — at b=2^62 the C (long long) and Python (bignum) bit-match (no overflow). The true error is a loss of output precision (the Bezout coefficient can’t be represented exactly in float64 above 2^53 so a·x+b·y==g breaks), and the b<=2^53 bound protects this precision. The mechanism was wrong but the defect and remedy stand = adopted.

P13 completion record — closest pair of points (divide and conquer) (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Extended computational geometry by 1 op (the 2nd geometry installment after P6/P7): closest_pair (KIND_REDUCE) = the minimum squared distance of a 2-D integer point set by divide and conquer (CLRS 33.4). Input [x0,y0,x1,y1,...] (2n values, integer coordinates [-1e5,1e5]) → output = the minimum squared Euclidean distance (integer-exact). Squared distance only (no sqrt) so it stays within long long/integer float64, C == Python bit match. The maximum squared distance = (2e5)²×2 = 8e10 < 2^53 = exact. fail-soft = fewer than 2 points (n<4) / odd length / non-integer coordinates or out of [-1e5,1e5] → -1.0.

P13 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 3-lens adversarial review Workflow (correctness / c-safety+gate-honesty / integration; each finding reproduced by a real compile/run mutation by a verification agent) = all 3 lenses converged on the same root cause → 1 CONFIRMED (severity = my initial rating MED / the verification agent HIGH, weighting a gate-honesty failure [the gate green-lights a wrong op] heavily. As honest disclosure both are stated; the fix is identical). The op itself is correct (mism 0 vs brute force on 30k+16k adversarial cases), but the difftest holdout doesn’t drive the strip’s y-scan past the immediate neighbor (j==i+1) → the gate can’t falsify a regression that truncates the strip forward scan to only j==i+1 (the 7-neighbor theorem is “at most 7”, not “1”, so a nearest pair non-adjacent in y order can really exist). Confirmed by self-reproduction: a mutation truncating the scan to range(i+1, min(i+2, sc)) applied to both _PY/_C → passed=True (MISSED). Searched an integer lattice for the minimal case that falsifies and found it (e.g. [0,-6,-2,-2,4,-3,-5,3] = the nearest pair is 2 apart in y order → full/brute force 20 but j==i+1-only 25). Fix = added 3 cases where the nearest pair is non-adjacent when y-sorted in the strip ([0,-6,-2,-2,4,-3,-5,3]→20 / [-4,5,-1,-3,0,-1,3,-3]→5 / [-1,-6,-1,0,-5,-4,1,-4,4,4]→8) to the holdout and the known-value test → on re-measurement the j==i+1-only mutation is CAUGHT (passed=False, pydiff=12), the baseline is a bit match pass on 61 cases, and no regression in the other 5 mutations. In addition to the existing 6 mutations (strip skip / sq ignores y / coordinate upper-lower limit / integrality / empty strip), the strip scan depth is now falsifiable too (extending P12’s gate-coverage lesson to geometry’s strip scan).

P14 completion record — the Huffman optimal prefix-code cost (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Extended data compression by 1 op (the 2nd compress installment after P5 rle_encode): huffman_cost (KIND_REDUCE) = the minimum total cost of the optimal prefix (Huffman) code for symbol frequencies [f0,f1,...] (non-negative integers ≤2^40) = the sum of the merge weights of all internal nodes (= Σ freq×code length). ★The core = the optimal cost is tie-invariant (per-symbol code lengths change with tie-breaking, but the total cost is unique for the frequency multiset), so even if C and Python pop equal-weight elements in a different order, the grand total is identical = the bit match holds cleanly. Carries integers in long long (bounded < 2^54 by the domain guard = no overflow).

P14 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 3-lens adversarial review Workflow (correctness / c-safety+gate-honesty / integration; each finding reproduced by a real mutation by a verification agent) = 3 CONFIRMED (all gate-coverage of the overflow-bail boundary; the op itself is correct and tie-invariance is already established on 50k+4k+20k). 0 correctness-family findings (tie-invariance claim, the two-queue optimality are robust). The CONFIRMED are all coverage of the “merge-total>2^53 fail-soft boundary”:

P15 completion record — the length of the longest increasing subsequence (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Extended search/selection by 1 op (the 2nd search installment after P8 binary_search/kth_smallest, a new DP/patience sorting algorithm family): lis_length (KIND_REDUCE) = the length of the longest strictly-increasing subsequence (LIS) of any NaN-free double sequence by patience sorting. Comparison-only (no arithmetic on the values) so the length is intrinsic to the array and unique = C == Python bit match. tails[k] holds the minimum tail of an increasing subsequence of length k+1, and each element replaces at the tails[mid] < x (bisect_left, strict) position or extends the end (O(n log n)). empty→0.0, NaN present→-1.0 fail-soft (detected by x != x).

P15 adversarial review result (2026-08-17, [[feedback_no_solo_ai_judgment]])

A 3-lens adversarial review Workflow (correctness / c-safety+gate-honesty / integration, mutation-verified) = 0 findings (no findings from any lens). Verified patience sorting’s strict comparison, the NaN guard, the tails buffer safety, the independence of the O(n²) DP oracle, and that the holdout drives the strict comparison alone; no falsifiable defect was detected. The prior mutation 3/3 caught (strict <<=/NaN guard/binary-search direction) and the 40k DP match show the gate is robust.

P16 completion record — the inversion count (merge-sort method) (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Extended statistics by 1 op (the 2nd stat installment after P9 count_distinct/mode_value): count_inversions (KIND_REDUCE) = the inversion count (the number of strict pairs with i<j and a[i] > a[j]) of any NaN-free double sequence by a counting merge sort in O(n log n). Comparison-only (no arithmetic on the values) so the count is intrinsic to the array and unique = C == Python bit match. On a merge, add the remaining left-side count each time the right side is taken first (classic). The count is a non-negative integer so -1.0 is a safe sentinel: NaN→-1.0 fail-soft, empty/single→0.0. Equal values are not inversions (on a tie take the left first = arr[i] <= arr[j]).

P16 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

★The first application of worktree-isolated review succeeded: 3 lenses × isolated git worktree (each agent makes its own copy from cd76da0 and mutates) → this repo’s algo.py stayed clean throughout (the verification agent too states “the real repo is read-only, mutation in an isolated worktree, cleaned up”). Structurally resolves P14’s contamination problem. Result = 2 CONFIRMED (both LOW), 0 correctness-family (the op is correct):

P17 completion record — the maximum subarray sum (Kadane’s method) (2026-08-17, Opus5[1m]/ultracode, 12h autonomous)

Extended search/optimization by 1 op (the 3rd search installment after P8 binary_search/kth_smallest, P15 lis_length): max_subarray (KIND_REDUCE) = the maximum sum of a contiguous subarray of an integer-valued double sequence by Kadane’s O(n) reset scan (cur = max(0, cur+x); best = max(best, cur)). Allows the empty subarray (sum 0) so the answer is always ≥ 0 (all-negative→0.0) = -1.0 is a safe sentinel. In the integer domain (each |x| ≤ 2^52 and the running sum of absolute values ≤ 2^52) it keeps every partial sum an exact integer < 2^53 → the answer is exact, C == Python bit match. The independent oracle (the brute-force max over all O(n²) subarrays) agrees exactly with Kadane thanks to the associativity of integer addition. fail-soft -1.0 = NaN / inf / non-integer / |x| > 2^52 / running-sum overflow.

P17 hardening after adversarial review (2026-08-17, [[feedback_no_solo_ai_judgment]])

Worktree-isolated review (4 agents, 3 lenses + an adversarial verify) = 1 CONFIRMED (LOW, gate-honesty) / 0 refuted. The verification agent reproduced everything in an isolated worktree and states this repo’s algo.py stayed uncontaminated (status --porcelain shows only the auto SESSION_SUMMARY). 0 correctness/integration-family (the op is correct):

2026-09-03: adversarial review (algo + C codegen), 8 fixes