Skip to content

defk-w8r.2: record the handwired study's speed lessons in docs/performance.md - #77

Merged
DanielLuning merged 1 commit into
mainfrom
defk-w8r.2/handwired-lessons
Oct 22, 2026
Merged

DanielLuning merged 1 commit into
mainfrom
defk-w8r.2/handwired-lessons

Conversation

@DanielLuning

Copy link
Copy Markdown
Owner

What changed

Records the speed lessons of the handwired study (a deleted prototype; the ticket defk-w8r.2 is the record) in docs/performance.md:

  • 2.19 Pattern search: anchor on a literal byte with :binary.matches/2, then verify in Elixir. Beats :re and a defk bit-parallel NFA 1.5 to 2x; a backtracking regex spelling cost 8x in :re.
  • 2.20 Literal search over many documents: :binary.matches/3 with a scope matches a shift-and kernel. A pointer bullet in 3.1.
  • 6.43 A bit-parallel NFA kernel costs about 3.2 ns per byte whatever the pattern (18 checked helper calls per byte); points at defk-w8r.3.
  • 6.44 Exact float32 through an [f32] scratch write is free (0.91x the f64 time), bit-exact in 15,000,030 results, 60x faster than rounding in Elixir; the 5.5x gap to C float is the runtime checks (defk-w8r.3); the builtin decision is defk-vcx.5.

The GPU data point (best CPU times 7 to 15 ms in 12 chunks against handwired's WebGPU 4.5 to 5.2 ms, an order of magnitude only) goes to docs/research/nx-boundary.md, replacing its "GPU not measured" line. docs/scope.md is unchanged: GPU stays Nx's, and a user page gets no ticket ids.

Results

No new measurement. Every number is copied from the ticket; each entry says one run, quiet machine, and that the source cannot be re-run. The three sketches carry defk-example skip markers with reasons, because they are fragments.

How it was checked

mix ci on the M-series Mac (2305 passed, 0 failures); mix defk.docs --check reports every generated region up to date.

  • Touches a promised surface? No: docs only, no CHANGELOG.md entry.
  • Touches test/stability/? No.

Five entries in docs/performance.md (2.19, 2.20, 6.43, 6.44 and a pointer
in 3.1): anchor-then-verify with :binary.matches beats :re and a defk NFA,
literal search ties a shift-and kernel, a backtracking regex spelling
costs 8x, the NFA kernel's per-byte cost, and exact float32 through an
[f32] scratch write. The GPU data point goes to docs/research/nx-boundary.md;
the scope line (GPU is Nx's) is unchanged. The research note and its
scripts were deleted; the ticket is the record.
DanielLuning pushed a commit that referenced this pull request Oct 21, 2026
…ired-lessons, worktree ../defk-w8r.2). Five entries in docs/performance.md (2.19, 2.20, 3.1 pointer, 6.43, 6.44) and the GPU data point in docs/research/nx-boundary.md; scope.md unchanged. mix ci green locally. Waits for the owner's merge; then bw close, bw sync, remove the worktree."
@DanielLuning
DanielLuning merged commit 8a8d8bb into main Oct 22, 2026
2 checks passed
@DanielLuning
DanielLuning deleted the defk-w8r.2/handwired-lessons branch October 22, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant