Skip to content

docs: spec 010, algorithm set and canonical I/O - #14

Merged
matbrgz merged 1 commit into
masterfrom
docs/spec-010-algorithm-set
Oct 12, 2026
Merged

matbrgz merged 1 commit into
masterfrom
docs/spec-010-algorithm-set

Conversation

@matbrgz

@matbrgz matbrgz commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Refs #11

Spec 010 (docs/specs/010-algorithm-set/). Docs only, no code.

Summary

  • Initial set: n-body, fannkuch-redux, spectral-norm, binary-trees and mandelbrot from the Benchmarks Game, plus merge-sort, binary-search and sha-256 over dataset-names. hello-world stays as the startup-cost baseline. The spec explains why each one is in, and why fasta, k-nucleotide, reverse-complement, regex-redux and pidigits are left out for now (they need regex, bignum or GB-scale I/O).
  • Canonical input: one size parameter n. The numeric benchmarks read no files. The name-based ones read deterministic samples from a pinned dataset-names release through the dataset-tool input contract (dataset-tool#1). The spec lists the catalog's needs for that contract and does not redefine its format.
  • Expected output: an exact stdout format per algorithm. Comparison is byte for byte after CRLF normalization. Ordering uses UTF-8 byte order, not locale collation. merge-sort, binary-search and sha-256 must be written by hand, without stdlib sort, search or hash functions.
  • Sizes: a check size plus measurement sizes. The largest numeric sizes match the Benchmarks Game.
  • Reference values: outputs and SHA-256 at the check size for the five numeric benchmarks, computed with a reference implementation. n-body, fannkuch-redux, spectral-norm and binary-trees match the well-known Benchmarks Game outputs. The mandelbrot n=200 check against the published file is still an open task in tasks.md.
  • Correctness before measuring: an untimed run at check size, plus an untimed run at each measured size, must match the expected checksum. A failure is recorded and never becomes a number. The mechanism belongs to spec 012.
  • Catalog contract: the spec lists what it hands to benchmark-tool#29 (algorithm ids for the algorithm test type, n, sizes, input references, checksums) and what stays with the contract (layout, metadata, Dockerfile, runner, markers).

Out of scope: layout migration (011), the correctness harness (012), measurement (013) and the implementations (014).

Note: this PR and #13 both append a row to docs/specs/ROADMAP.md. Whichever merges second needs a trivial rebase.

🤖 Generated with Claude Code

Pick the first classic algorithms (n-body, fannkuch-redux,
spectral-norm, binary-trees and mandelbrot from the Benchmarks Game,
plus merge-sort, binary-search and sha-256 over dataset-names) with
Hello World as the startup baseline. For each one, define the canonical
input by size n, the expected output with SHA-256, the sizes, and the
untimed correctness rule. Inputs reference the dataset-tool input
contract and the mapping references the benchmark-tool catalog
contract without redefining either.

Refs #11

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@matbrgz
matbrgz merged commit ad34408 into master Oct 12, 2026
10 checks passed
@matbrgz
matbrgz deleted the docs/spec-010-algorithm-set branch October 12, 2026 17:11
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