Skip to content

Experiment: hybrid Roaring retrieval on CH/DE/FR/GB/IT with cache diagnostics - #21

Draft
kylerchin wants to merge 57 commits into
mainfrom
bench/switzerland-open-geocode-ab
Draft

kylerchin wants to merge 57 commits into
mainfrom
bench/switzerland-open-geocode-ab

Conversation

@kylerchin

@kylerchin kylerchin commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Experiment

Compare pinned Cypress main's delta-varint token index against this branch's scalar Roaring-inspired hybrid index. Import complete Switzerland, Germany, France, United Kingdom and Italy extracts into one disposable Scylla database. The 184 multilingual CH/DE/FR queries stay fixed to measure corpus growth and competing matches; this is not a GB/IT query-quality benchmark.

The experiment retains canonical multilingual StringIds, FST lookup, rarest-first posting selection, fuzzy fallback and existing final ranking. Sparse containers use u16 arrays; dense containers use 8192-byte bitmaps. This custom implementation does not include upstream Roaring SIMD or run containers.

Intersections now filter the decoded anchor buffer in place and advance a forward container cursor for each probe, avoiding a second candidate vector and repeated top-level binary searches.

Cache protocol and diagnostics

After each variant's index compilation, flush and restart the disposable Scylla container, wait for CQL readiness, then start its query server. Preserve the database contents.

Record one first pass without warmup separately from two warmup cycles and eleven measured cycles. A Scylla restart resets process caches but leaves Linux page cache intact; compilation and mmap validation touch index pages. Adding countries increases corpus size but does not guarantee cold-disk lookups.

Report RSS, anonymous/file RSS and process high-water RSS. Archive smaps_rollup, fault counters, process I/O, host memory and Scylla snapshots at startup, after first pass and after measurement. Automatically summarize request phases and fallback counts in log-analysis.json.

Findings from the previous three-country run

Inspected run 43209312101, including the query logs and full observations:

Metric main hybrid
Warm HTTP p50 ms 4.632 4.420
Warm HTTP p95 ms 74.495 65.504
Warm HTTP p99 ms 88.569 75.007
End RSS KiB 2,422,292 2,469,780
Token sidecar bytes 70,928,686 97,258,692
Ordered-ID differences — 0/184

Both variants had 598 fallback plans out of 2,392 logged plans, including warmup. Experimental logs attribute 10,475 ms to fallback bigram expansion, 6,464 ms to count-snapshot caching and 6,365 ms to cosine candidates. Scylla place fetches totalled 466 ms. Nested timers overlap and these totals are not isolated CPU profiles.

Compiler logs show 3,630,618 array containers versus only 55 bitmap containers: sparse-container headers impose substantial overhead. The format remains unchanged in this adjustment; the new measurements must decide whether its space/latency tradeoff is worthwhile.

Paper audit

  • SEA 2025 integer-index comparison: its Roaring implementation includes SIMD/run containers; its integer lookup results cannot be transferred to this custom geocoder implementation.
  • Zombit, §2.5: iterator reuse motivates the forward-cursor correction. Scalar filtering still differs from optimized container set operations.
  • UniTopRank: gazetteer retrieval plus document-context beam-search ranking, not a posting-index design. Cypress does not implement that algorithm.
  • POISS: graded, geo-anchored natural-language relevance evaluation. Approximate-coordinate fixtures and baseline ID parity are not equivalent quality evaluation.

See the experiment notes for encoding, audit details and reproducibility.

Validation

  • cargo check --locked --all-targets passed.
  • Compiler Roaring tests: 3 passed, including mixed dense/sparse intersection equivalence.
  • Library Roaring tests: 2 passed.
  • Query tests: 36 passed, 1 ignored.
  • Shell syntax, Python compilation, existing-artifact report compatibility and synthetic memory/first-pass report checks passed.
  • Full five-country benchmark has not been run for this revision.

Run the A/B workflow on branch bench/switzerland-open-geocode-ab. Keep this experimental until the expanded benchmark establishes acceptable latency, RSS and ranking parity.

@kylerchin
kylerchin marked this pull request as ready for review November 11, 2026 20:34
@kylerchin kylerchin changed the title Experiment with open-geocode-inspired memdb retrieval against production Cypress main on Switzerland Experiment: packed mmap posting format vs Cypress main across Switzerland, Germany and France Nov 12, 2026
@kylerchin kylerchin changed the title Experiment: packed mmap posting format vs Cypress main across Switzerland, Germany and France Experiment: Roaring-style hybrid posting index and adaptive retrieval vs Cypress main (CH/DE/FR) Nov 12, 2026
@kylerchin
kylerchin marked this pull request as draft November 12, 2026 08:35
@kylerchin kylerchin changed the title Experiment: Roaring-style hybrid posting index and adaptive retrieval vs Cypress main (CH/DE/FR) Experiment: hybrid Roaring retrieval on CH/DE/FR/GB/IT with cache diagnostics Nov 12, 2026
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