IndexFORGE is a Claude-driven workflow for generating and iteratively improving C++ in-memory indexes from natural-language workload descriptions. The project was previously named IFM-Claude; a few internal identifiers retain that old name for compatibility. IndexFORGE turns one workload into a frozen benchmark, explores legal index designs, checks each implementation for correctness, measures it, diagnoses the bottleneck, and records the complete search as a Design Version Graph (DVG).
The repository contains the workflow and deterministic infrastructure, not
generated experiment outputs. DVGOutput/ is intentionally empty and ignored
by Git.
workload .spec
|
v
workload contract
|
v
frozen Arena + design facts + complexity analysis
|
v
cDDG design -> C++ IndexEngine -> correctness -> measurement
^ |
| v
+--------- redesign/reimplement <- diagnosis
|
v
record DVG and promote best
Claude supplies the judgment: it interprets the workload, chooses a legal cDDG design, writes the implementation, diagnoses each result, and chooses the next move. Repository-local scripts supply the reproducible mechanics: freezing the Arena, validating artifacts, enforcing correctness gates, measuring repeated runs, recording lineage, and selecting the incumbent.
The deterministic repository scripts do not call a model API or require an external benchmark checkout; Claude Code is the agent interface.
OrderedQueryBench (OQB) is the external benchmark suite used for the final cross-system evaluation of generated indexes. It is not a dependency of the core in-memory workflow and is not used by the minimal example below. OQB, together with the complete end-to-end experimental procedure and result artifacts, will be released in a later update.
All official baseline implementations used by the experiments are included in
experiments/baselines/, together
with their frozen upstream source snapshots, adapters, evaluator glue, runners,
version manifest, and upstream licenses. See the baseline package's
README.md for the inventory. The
small OQB harness subset inside this archive is a frozen compilation dependency
for the adapters, not the standalone OQB release.
Disk-mode code remains in the tree only as a research case study; it is not part of the primary workflow documented here.
SKILL.md complete agent workflow and invariants
FAIRNESS_PROTOCOL.md protocol for claim-grade evaluations
examples/minimal_memory.spec small standalone example workload
design_space/
DesignDecisionGraph.yaml authoritative cDDG design space
cddg_cheatsheet.md compact cDDG map
complexity_playbook.md workload and complexity reasoning guide
references/
coder_contract.md generated IndexEngine API
microbench_spec.md workload-contract and Arena semantics
diagnoser_method.md diagnosis and next-move procedure
templates/ deterministic generated-artifact templates
scripts/ freeze, validate, measure, record, and promote
tests/ regression and negative tests
experiments/baselines/ official baseline sources, glue, and runners
DVGOutput/ generated runs; ignored by Git
- Claude Code, launched from this repository
- Python 3.10 or newer
- PyYAML
- Bash
- a C++17 compiler (
g++by default) tasksetfor CPU-pinned measurements
Install the only Python package required by the core scripts:
python3 -m pip install PyYAMLThe included example is deliberately small: 50,000 pre-filled uint64 keys,
5,000 untimed warm-up reads, and 50,000 measured reads. A three-node budget means
the initial implementation plus at most two redesign/reimplementation steps.
From the repository root, launch Claude Code:
claudeThen paste this prompt:
Run a complete IndexFORGE Design Version Graph experiment in this repository.
Treat the current working directory as the repository root. First read
./SKILL.md and follow its memory workflow and invariants exactly. Do the work
with the local shell and files; do not merely describe commands.
Inputs:
- workload: examples/minimal_memory.spec
- run directory: DVGOutput/minimal-memory-demo
- node budget: 3 total nodes, including n0
- freeze scale: 50,000 pre-fill records, 5,000 warm-up operations,
50,000 measured operations, seed 42
- measurement: 3 repetitions per candidate
- mode: in-memory only
- oqb_target: false
- full_rerun: false
Claude will create the run under:
DVGOutput/minimal-memory-demo/
workload_contract.json
design_facts.json
complexity_analysis.md
microbench/ frozen driver and metadata
_work/ unrecorded candidate scratch space
nodes/n0/ initial recorded version
nodes/n1/ ... later versions, if created
nodes/best-node/ promoted winning version
dvg.json nodes, edges, metrics, and selection history
BEST.json final winner pointer
The node budget counts versions, not retries. With budget: 3, the normal path
is n0 -> n1 -> n2:
n0establishes the first legal, correct, measured design.- Its diagnosis chooses either
redesign,reimplement, orstop. - A redesign changes the cDDG design hash; a reimplementation preserves it.
- The next candidate is evaluated on the same frozen Arena and recorded as a new node.
- The loop repeats until the budget is exhausted or the deterministic stop gate accepts an earlier stop.
Failed drafts do not become nodes. A candidate becomes a node only after the API, design, build, correctness, measurement, and diagnosis gates pass.
Start Claude again in the repository and paste:
Resume the existing IndexFORGE run at DVGOutput/minimal-memory-demo. Read SKILL.md,
the frozen workload_contract.json, microbench metadata, complexity analysis,
dvg.json, and the latest recorded node and diagnosis. Do not refreeze or modify
the Arena, do not restart at n0, and do not use external benchmark results.
Continue the DVG loop with the original total budget of 3 nodes, then promote
the winner and report the completed graph. If an unrecorded _work candidate is
present, validate its provenance before deciding whether to finish or discard
that draft.
For a new memory workload, copy this prompt and replace the bracketed values:
Run a complete IndexFORGE Design Version Graph experiment in this repository.
Treat the current working directory as the repository root. First read
./SKILL.md and follow its memory workflow and invariants exactly. Do the work
with the local shell and files; do not merely describe commands.
Inputs:
- workload: [PATH_TO_SPEC]
- run directory: DVGOutput/[RUN_NAME]
- node budget: [BUDGET] total nodes, including n0
- freeze scale: [PRE_FILL] pre-fill records, [WARMUP] warm-up operations,
[OPS] measured operations, seed [SEED]
- measurement: [REPS] repetitions per candidate
- mode: in-memory only
- oqb_target: false
- full_rerun: [true/false]
A semantic workload change must use a new run directory. Reusing an existing run while changing its frozen contract or Arena invalidates comparisons between nodes.
- The workload contract, Arena, and complexity analysis are frozen before candidates are compared.
- All candidates compile against the same driver and compiler configuration.
- Warm-up and measured results are checked against an independent plan-time oracle; a digest mismatch produces no selectable metric.
- Repeated measurements retain their samples and noise estimates.
- Design identity and implementation lineage are recorded separately.
- Generated candidate code must remain benchmark-neutral.
For quantitative claims, also follow
FAIRNESS_PROTOCOL.md: freeze the exact prompt and input
set, and keep development workloads separate from final evaluation workloads.
Run the complete regression suite from the repository root:
bash tests/run_all.shOr select the memory-focused subset:
ONLY=reference_api,arena,cddg,gates,selection bash tests/run_all.shThe suite checks API semantics, workload realization, correctness gates, cDDG validation, diagnosis and stopping rules, DVG recording and selection, optional harness glue, and static syntax checks.