Repository navigation
Rank Reuse 08 EN
한국어 · Measurements · Corpus and limitations
Repeated-search allocation decreased; a large latency improvement or resident-memory reduction was not established. The same 2,948 questions and 3,009 candidates were used. No new training, data selection or scoring change occurred.
pkg/hintsearch.Index.RankInto(query, previous) reuses caller-owned order/score arrays. Existing Rank continues returning independently owned results. Scores, ties, zero-score documents and the complete candidate set are preserved.
var scratch hintsearch.Ranking
for _, query := range queries {
var err error
scratch, err = index.RankInto(query, scratch)
if err != nil {
return err
}
// Consume scratch.Order and scratch.Scores before the next call.
}The next reuse overwrites these arrays. Copy retained results or use Rank. Concurrent workers need separate buffers; the index remains immutable. No shared pool, map or mutex was introduced. Invalid queries return before mutating the buffers. Reuse across larger/smaller indexes resizes and clears scores appropriately.
The one-request riido-hints CLI does not gain repeated-query savings merely from this addition. Intended users are Go callers and a future daemon querying the same index repeatedly. The evaluator exposes --reuse-rank for direct use.
Four process runs used fresh → reuse → reuse → fresh order. Each evaluated both raw/identifier modes. Hashes cover every candidate position and float64 score bit for every question; all four matched. All earlier 07 overall, name-stratum and repository quality metrics also matched.
| Run | Combined query-loop cumulative allocation | Full wall time | Peak RSS |
|---|---|---|---|
| Fresh 1 | 298,879,080 B | 1.89s | 102,465,536 B |
| Reuse 1 | 9,176,888 B | 1.50s | 92,291,072 B |
| Reuse 2 | 9,176,888 B | 1.50s | 93,503,488 B |
| Fresh 2 | 298,884,224 B | 1.52s | 91,062,272 B |
Cumulative allocation decreased by about 96.93%. These Go TotalAlloc deltas cover two loops of 2,948 queries, including preprocessing, trace hashing and metric collection. They are not live memory or model size. Source/archive checks and index construction are excluded from loop allocation but included in whole-process wall/RSS. Fresh run 2 had lower peak RSS than reuse, so no peak-RSS improvement is established. Per-query p95 also remained similar; raw values are in JSON.
Original public fixture strings form catalogs of 64/3,009 candidates with one repeated query. Medians are from five 300ms runs per configuration. This is separate from the diverse corpus evaluation.
| Candidates | Mode | New bytes/op | Allocs/op | Median time |
|---|---|---|---|---|
| 64 | Fresh | 1,112 B | 5 | 655.3ns |
| 64 | Reuse | 88 B | 3 | 588.9ns |
| 3,009 | Fresh | 49,240 B | 5 | 59,595ns |
| 3,009 | Reuse | 88 B | 3 | 59,493ns |
At 3,009 candidates, new bytes/op decreased by about 99.82%, with negligible time change. Reusable arrays still occupy caller-owned memory after preparation; 88 bytes measures subsequent new allocation only. Tokenization and sorting costs remain. This is not a SIMD experiment.
Apple M4 Pro/Go1.27.1 CPU. Prepare experiment 07's pinned source and archives.
go test -race ./pkg/hintsearch ./internal/retrievalbench
go test ./pkg/hintsearch -run '^$' -bench BenchmarkRankReuse -benchmem -benchtime=300ms -count=5
go run ./cmd/riido-retrievalbench --stage evaluate
go run ./cmd/riido-retrievalbench --stage evaluate --reuse-rankRegression tests cover stale-score removal across different queries, missing-term/tied candidates, changing index sizes, nonmutation on invalid input and concurrent queries with separate buffers. Existing analytical BM25 and candidate-preservation tests remain.
This establishes a runtime allocation improvement, not a new model-quality, real-agent-success or LLM-savings result. A later semantic experiment must predict auxiliary-search usefulness from runtime-observable signals with separate data and evaluation criteria.
riidolaya is experimental. No demonstrated Codex cost savings; repository selection is preview-only.
riidolaya는 실험 단계입니다. Codex 절감은 미입증이며 저장소 선택은 preview입니다.
English README · 한국어 README · Versioned Wiki sources / Wiki 원본
이전 연구 안내 펼치기 / Earlier research
- 실제 이어 학습 V3 · 한국어 · Actual V3 training · English
- 진행·완료 보고·질문100건 결과 KO · 100-case results EN
- 라벨·이모지·상태 힌트 KO · Content/state hints EN
- 개발 진행·완료 보고·질문 pilot KO · Development pilot EN
- 작은 검증 기록 KO · Compact evidence EN
- 현재 개발 자료 35개·다음 학습 조건 · 35-row data and next training gates
- 개발용 학습 자료 2개 · Two qualified training requests
- 첫 두 과제 실제 관측 · First two actual observations
- 전체 사용법 KO · Full usage EN
- 작은 동작 힌트 KO · Small hints EN
- 설명 보강 비교76 · Caption diagnostic76
- Go 압축 가중치78 · Packed Go weights78
- 공개 함수 동작 검증 · Public function verification
- 다음 학습 자료 준비 · Training data preparation
- 동작에서 학습 정답·실제 학습79 · Grounded labels and actual fit79
- 소스 동작 관찰 · Source observations
- 저장 크기와 RAM · Storage and RAM
- 라이선스 · Licensing
- 시점별 기록 원문 / Chronological history
- 전체 연구 링크 / Full research index
- 문서 목록 / Documentation