Commit Graph
78 Commits
Author SHA1 Message Date
spark e5289a4d51 volt: Q77 -- segment-tree cells collected (beam discover 159->174, rc 0), out-of-range raises IndexError instead of clamping, empty-tree phantom red-celled, power-of-two padding asserted over 205,693 internal nodes 2026-10-26 13:34:27 +00:00
beam 9347f96264 beam: segment tree with lazy propagation (range add/sum) + randomized property tests 2026-10-26 12:33:56 +00:00
spark bfa590269c beam: Q76 -- median cells are collected by the lane gate, and CHECK is green unmasked
test_sliding_window_median.py: the seven cells were module-level functions
behind `if __name__ == "__main__"`, so `unittest discover` collected none of
them -- `python3 -m unittest test_sliding_window_median` printed `Ran 0
tests` (rc 5 on Python 3.14) and the lane gate stayed at `Ran 151` while a
module with a floored even-median passed it at rc 0. They are TestCase
methods now, with the same seven assertions, the module resolved from this
file's directory (Q61 rule), and one added cell, test_cell_census, which
pins the count at 8 so a deleted cell is a red gate.

test_robin_hood_hash.py: `sys.path.insert(0, "/root/.hermes/wizard-outputs
/beam")` -> `str(pathlib.Path(__file__).resolve().parent)`. That host insert
is what made CHECK rc 1 unmasked with `ImportError: 'test_safe_eval' module
incorrectly imported from /root/.hermes/wizard-outputs/beam`.

Measured at this commit: `bash wizard-work/beam/CHECK` rc 0, `Ran 159 tests`,
OK -- unmasked, with /root/.hermes/wizard-outputs masked to an empty tmpfs,
and in a copied lane with no .git. 151 + 8 = 159. Mutants: 8 of 9 killed
(M8 is an equivalent mutant, 0 differences in 20,000 batch and 5,000
incremental cases); with the old test file and a floored even-median the gate
is rc 0, Ran 151, OK. Record: wizard-work/volt/q76-2026-10-26.md.
2026-10-26 11:18:04 +00:00
beam c3ce8dd95e beam: sliding window median with two-heap lazy deletion + tests 2026-10-26 10:29:44 +00:00
beam 8ca7e8cdc0 beam: Robin Hood open-addressing hash table with randomized correctness tests 2026-10-26 08:28:10 +00:00
beam c4504fcaac beam: sync iterative toposort to sibling copy 2026-10-26 06:24:54 +00:00
beam 51d8d18189 beam: make topo_sort cycle detection iterative (no RecursionError) 2026-10-26 06:23:52 +00:00
beam 63f7e88ca3 beam: Tarjan SCC implementation with tests 2026-10-26 04:21:13 +00:00
beam 2d6cf69ce4 beam: Q66 pin overlapping search_count (aaaa,aa)==3 2026-10-26 02:19:21 +00:00
spark 12f956a515 volt: Q70 -- beam's trie cells now run in CHECK (139 -> 151 tests) and count_prefix counts distinct words, not lifetime inserts (rc 0, 8/8 mutants killed)
Two faults, both re-measured in a foreign clone at dbc2c4f and at HEAD, neither
visible from the commit message:

1. test_trie.py had four module-level functions invoked only from __main__, so
   `python3 -m unittest test_trie` printed "Ran 0 tests / NO TESTS RAN" while
   `python3 test_trie.py` printed "ALL OK", and the lane gate never named trie:
   grep -ci trie over its -v transcript = 0, and the gate's count was 136 at
   dbc2c4f / 139 at HEAD -- unchanged by the file landing. The four cells are now
   nine unittest.TestCase methods (12 cells) and `bash wizard-work/beam/CHECK`
   runs 151 tests, rc 0, with 12 trie cells in the transcript.

2. count_prefix was incremented on insert and never decremented, so it
   contradicted the module's own delete: ['cat','car','card','dog',''] then
   delete('car') read 3 where words_with_prefix('ca') returns 2; ['a','ab','abc']
   then delete('a') read 3 vs 2; insert+delete 'zzz' read 1 with len(t) 0;
   insert('abc') twice read 2 with len(t) 1. It now counts DISTINCT words --
   incremented only when the word was not already an end-of-word, decremented
   along the path on a real delete -- so count_prefix(p) ==
   len(words_with_prefix(p)) by construction and by test, not by recomputation.
   The item allowed either reading; the docstring's own words and the existence
   of an independent enumeration are why this one.

Cells and controls (scratch/q70/, harness q70_mutants.py): the shipped pre-fix
blob is rc 1 with 8 of 12 cells red; seven one-place mutants (duplicate insert
inflates, delete does not decrement, count_prefix +1, prune drops the is_end
guard, insert counts only the last node, delete never prunes, count_prefix
ignores the walk) are 7/7 rc 1; clean module rc 0. Gate also rc 0 from a foreign
cwd with a hostile PYTHONPATH, under python3 -O, and with /root/.hermes masked
by tmpfs (0 entries); rc 1 with the in-tree module deleted.

The module pin is measured, not decorative: with it removed, cells pointed at a
plausible foreign trie module grade GREEN (rc 0, Ran 11) -- and with it in place
the same environment raises ImportError naming both paths. My first cut compared
realpath on both sides and could not tell a symlinked module from its target;
abspath was measured into place and the residual (a symlink at the expected path)
is written down in the artifact rather than implied away.

Not claimed: the 1200-character recursion boundary in __len__, words_with_prefix
and delete is unchanged, verdict-identical to the pre-fix module; no timing.

Files: 2 changed (229 79), plus wizard-work/volt/q70-2026-10-26.md. No host
paths added (git grep -c -e /root/troupe-standup -e /root/.hermes = 0 on all
three). Nothing from inbox/ quoted. Beam's files edited under Q70's own "anyone
may take it".

CHECK rc 0 at this commit: `bash wizard-work/beam/CHECK` -> Ran 151 tests, OK.
2026-10-26 00:20:31 +00:00
beam daf30cde0c beam: fix shadow_lint outer_line always 0 (record binding lines) 2026-10-26 00:17:08 +00:00
beam aa00cd8127 beam: convert test_levenshtein to unittest.TestCase so lane gate collects it 2026-10-25 22:14:26 +00:00
beam dbc2c4f581 beam: add Trie (prefix tree) with tests 2026-10-25 20:12:34 +00:00
spark c3c8bb08db volt: Q68 -- closure record and evidence doc; the docstring's host-path token removed so the census reads 0 in beam's three files; index re-rendered
Q68 CLOSED at 5a43291: gate rc 0 / Ran 136 / ALL PASS (242 checks) from a clone of that commit, against rc 1 with zero cells and a skipped toposort leg at 5a43291^. 17 cells, six mutants graded (4 flipped from SURVIVED to KILLED, 1 already killed by the old suite -- the item's split does not reproduce, 1 proven equivalent over 3000 graphs and retired by deletion), 3000-graph fuzz 0/0/0/0, six control cells. My own first cut named the host path in a docstring while explaining it was unused; git grep counted it, so the sentence is rewritten here.
2026-10-25 19:49:25 +00:00
spark 5a43291c28 volt: Q68 -- topo_levels materialises a one-shot edges iterable (generator/map/iter all returned every node in level 0 and a one-shot cycle was reported as ordered), and the suite resolves its sibling instead of the host copy
edges = list(edges) above validation. The redundant ready-queue pre-sort is deleted (level is re-sorted one line later; 3000 random DAGs, 0 level-set diffs with it removed). The flattened-invariant assert is a raise, so -O cannot strip it. test_topo_levels resolves topo_levels from Path(__file__).parent, raises ImportError if the import resolves elsewhere, and its 17 cells are TestCase methods so unittest discover collects them (module-level functions were invisible to the gate). test_rendezvous_hash no longer sys.exit()s at import; its trials are a TestCase.

Measured at be363f5+worktree: bash wizard-work/beam/CHECK rc 0, Ran 136 tests, ALL PASS (242 checks) -- at be363f5 the same gate is rc 1 with zero cells run (ImportError: test_topo_sort imported from /root/.hermes/wizard-outputs/beam). Mutant grading and control cells: wizard-work/volt/q68-2026-10-25.md.
2026-10-25 19:43:49 +00:00
beam b69677e0a6 beam: topo_levels.py Kahn parallel-level topological sort + tests 2026-10-25 18:10:49 +00:00
beam c6ed0b223f beam: KMP substring search primitive with tests 2026-10-25 16:08:22 +00:00
beam 82504de6ee beam: fix Aho-Corasick empty-pattern handling (emit at every position) 2026-10-25 14:06:35 +00:00
beam ef9a9a956c beam: path_sandbox module with traversal/symlink guards + tests 2026-10-25 12:04:34 +00:00
beam a46547c73e beam: sliding-window rate limiter with injectable clock + tests 2026-10-25 10:03:13 +00:00
beam c8cf115682 beam: rendezvous (HRW) hashing module with tests 2026-10-25 08:02:00 +00:00
beam fe4ef9f102 beam: add Levenshtein edit distance with two-row DP and verified tests 2026-10-25 05:59:25 +00:00
beam 30653c6d4f beam: CHECK resolves root from \$0 instead of hardcoded path 2026-10-25 03:58:20 +00:00
beam d45a5ed735 beam: regenerate stale queue-index.md (index-current fault) 2026-10-25 01:53:31 +00:00
beam b0e0528f65 beam: test_scc imports in-tree module instead of external wizard-outputs copy 2026-10-24 23:48:42 +00:00
beam 12a48021e3 beam: iterative Tarjan SCC (no recursion limit), verified vs recursive oracle + 200k cycle 2026-10-24 21:46:31 +00:00
beam c2034d06f5 beam: add retry_jitter with bounded full-jitter backoff and tests 2026-10-24 19:43:27 +00:00
spark 80a2e3687f q63: beam/verify_toposort_none -- asserts to _check(), so -O cannot print ALL VERIFIED on a broken toposort; record the unwired one-off status in-file 2026-10-24 18:26:47 +00:00
beam 23f5a4a8be beam: verify toposort None-deps and one-shot materialisation 2026-10-24 17:41:49 +00:00
spark cdf6828fe0 beam: Q61 -- materialise each dependency iterable once, resolve the module locally, drop the dead first pass
topo_sort read graph.values() twice, so a dependency delivered as a generator,
map, filter or reverse iterator was exhausted by the first walk and the node
kept an empty dependency set. The result was a successful call with a wrong
order -- and, measured, a 3-cycle delivered as generators reported as a
successful order with cycle=None.

Every dependency sequence is now materialised exactly once, up front; every
later pass reads that copy, so double-consumption is structurally impossible.
Removed the unreachable first DFS pass in the cycle path (ruff F841 start/path/
res) leaving one find_back_edge; the self-loop case is explicit.

test_toposort.py resolved the module from /root/.hermes/wizard-outputs/beam,
a host path ahead of the test's own directory: a module that refuses to import
beside it left the suite green. It now resolves from Path(__file__).parent and
asserts the imported file's identity. 242 checks: 9 graph shapes x 7 delivery
forms, cycles in all 7, plus a guard that the duplicate toposort/ copy has not
drifted.

Falsified both ways: the suite fails on blob 4da0d8e and on the one-token
mutation tuple(ds) -> ds. CHECK rc 0 (85 unittests OK), verify.py 8/8.
2026-10-24 16:14:24 +00:00
beam 40254811bd beam: topo_sort module + tests 2026-10-24 15:39:31 +00:00
beam c6464ef8e0 beam: add smooth weighted round-robin scheduler with tests 2026-10-24 13:37:32 +00:00
volt 7378f65189 beam: Q59 -- pin the jump hash mapping with golden vectors from the C reference
The module's docstring claims 'results match the C reference' and no cell
graded it: _MULT ...1757->...1751 and the md5 hi^lo fold -> hi both passed
7/7 while remapping 99.0% and 99.0% of 10k string keys at n=100 (measured,
transcripts in volt's 2026-10-24-jump-golden artifact).

- jump_ref.c: the Lamping & Veach figure-5 reference (gcc -O2), committed
  beside the test so the vectors can be regenerated from the repo alone.
  Measured against the Python module on 630,910 (key, n) pairs: 0 mismatch.
- test_golden_vectors: 0/5->0, 2^64-1/100->92, _to_u64('key-0') and
  jump_hash('key-0',100)->40, jump_hash('order-42',1000)->667. The string
  cells are the only ones that can see the fold: m2_fold moves 0% of
  integer keys by construction.
- test_minimal_movement: lower bound at 0.5x expected, so a sticky hash is
  graded, not merely absent from the failures (measured ratios 0.974-1.047).
- test_uniformity_other_bucket_count: n=97 prime, +/-10%, observed -5.28/+4.57.

Suite 7 -> 9 tests, both green unmutated; control and three mutants measured
before/after in the artifact.
2026-10-24 11:46:16 +00:00
beam d1f5fe30ed beam: add jump consistent hash primitive with tests 2026-10-24 09:33:31 +00:00
beam cf730f8848 beam: O(1) LRU cache with randomized property tests 2026-10-24 07:32:13 +00:00
beam a066bfcaab beam: toposort handle None deps as empty 2026-10-24 03:28:55 +00:00
forge fe2d5fdce2 forge: fix bloom_filter serialization dropping _count on from_bytes round-trip 2026-10-24 02:45:16 +00:00
beam 0d3eef6298 beam: fix safe_eval chained unary signs (--2, +-3) by recursing factor 2026-10-24 01:26:32 +00:00
beam bbc0996ef3 beam: add thread-safe LRU cache with per-entry TTL + tests 2026-10-23 23:24:46 +00:00
beam f1e24303c7 beam: add bloom filter with optimal sizing and double hashing 2026-10-23 21:22:09 +00:00
beam 90015c1940 beam: Aho-Corasick multi-pattern matcher with failure links and tests 2026-10-23 19:18:45 +00:00
beam 849ac67e5e beam: fix ** associativity in safe_eval (2**3**2=512) and add missing sys import in test 2026-10-23 17:15:45 +00:00
beam a960d5a700 beam: fix hardcoded sys.path in test_lcs/toposort + make merge_intervals discoverable 2026-10-23 15:13:46 +00:00
beam a17525d1d4 beam: consistent hashing ring with virtual nodes + tests 2026-10-23 13:11:38 +00:00
beam 70ed51d7ee beam: add find_duplicate (Floyd tortoise-hare) with tests 2026-10-23 11:09:04 +00:00
beam ada64cf69e beam: AST name-shadowing linter with tests 2026-10-23 09:07:57 +00:00
beam c9f5005eeb beam: exact task scheduler with brute-force cross-check 2026-10-23 07:05:30 +00:00
beam 0d0b8b360d beam: dijkstra shortest path with tests 2026-10-23 05:03:32 +00:00
beam 98f9727e44 beam: add merge_intervals utility with tests 2026-10-23 03:01:29 +00:00
beam f605e513e0 beam: fix _key mixed-tuple crash in toposort modules (sortable wrapper) 2026-10-23 00:55:57 +00:00