AGENTS.md
libs/columnar/AGENTS.mdAGENTS.md
Quality
67/100
Scores the file, not the repository.Length
467 words
6 headings · 0 code blocksRepository
78k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# ColumNAR — contributor & agent guide23Read `README.md` for the architecture first, then this. It covers what is expensive to get wrong.45## Non-negotiable rules671. **Binary only.** ColumNAR stores and serves fields at the `BINARY` surface (`addBinaryField` /8 `getBinary`); the typed shapes (`Numeric`/`SortedNumeric`/`Sorted`/`SortedSet`) throw. There is no9 delegate format — an unsupported type is an error, not a fallback.10112. **Type-tagged and open.** Every field carries a `ColumnarFieldType` (`columnar.type` attribute).12 `LONG`/`DOUBLE` are the numeric column today; new types (`STRING`, …) slot in by extending13 the write dispatch (consumer) and read dispatch (producer) — the field framing is generic.14153. **The integration chooses the encoding.** Encoding is a per-field decision driven by what the16 integration knows (type, sorted, metric role). Keep that seam open; don't hard-wire one pipeline.17184. **Insertion order is preserved.** The numeric column never sorts or deduplicates; value ordinals19 stay internal to the presence layer.20215. **Never hold a column on the heap.** Read, write and merge stream one block at a time. Offset22 tables use `DirectMonotonic` (temp file on write, mapped slice on read); presence uses23 `IndexedDISI`. Only bounded metadata and one decode block stay in memory.2425## Encoders2627A block is encoded by a `NumericPipeline`: adaptive `BlockTransform`s (delta, offset, GCD — reversible28in-place transforms that fire only when they shrink the block) then one `BlockTerminal` (FOR29bit-packing) that serializes the residuals. The default pipeline runs all detection; a field can be30handed an explicit pipeline to skip it.3132**Adding an encoder** — additive and backward-compatible:33341. Implement `BlockTransform` (adaptive, mutates the `long[]` in place) or `BlockTerminal` (serializes35 it) with a new, **frozen** `byte` id.362. Register the id in `NumericPipeline.Registry`.373. Add it to a pipeline — the default or a per-field one.3839A column records its stage ids in metadata, so old data lists only old ids and a newer reader rebuilds40the exact pipeline and decodes it unchanged. Never reuse or renumber a shipped id.4142## Versioning4344Each segment stamps `ColumnarFormat.VERSION_CURRENT`; readers accept `[VERSION_START, VERSION_CURRENT]`45and reject anything newer. Most evolution needs no bump — new encoders, field types and block-bytes46codecs ride frozen ids recorded per column. Only a change to the metadata *layout* needs a version47bump; then branch on the header version (returned by `ColumnarCodecUtil.checkHeader`) in the affected48`readFrom`.4950## Benchmarks & tests5152Ship every format change with round-trip and range/bulk correctness coverage. JMH benchmarks live53in the `:benchmarks` module (`org.elasticsearch.benchmark.index.codec.columnar`) and compare ColumNAR54against the TSDB codecs; no results are committed. See `docs/BENCHMARKS.md`.5556## Build & verify5758- `./gradlew :libs:columnar:spotlessApply` — format (no wildcard imports; don't reorder untouched lines).59- `./gradlew :libs:columnar:test` — tests.60- Dependencies stay minimal (`lucene-core`, `libs:simdvec`) and need justification. Never depend on61 `server` — `server` will depend on this library.6263The repo-wide top-level `AGENTS.md` governs formatting, logging, Javadoc, and license headers.64
Also in elastic/elasticsearch
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| elastic/elasticsearchAGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+6 | 96/100 | 3 days ago | |
| elastic/elasticsearchbenchmarks/AGENTS.md · 78k | AGENTS.md | test | 54/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/esql/compute/AGENTS.md · 78k | AGENTS.md | no sections | 25/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/inference/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+3 | 100/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| elastic/elasticsearchx-pack/plugin/inference/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+3 | 100/100 | 3 days ago |
