P5b given test: the embedding-cache test used a 12-page document (4.6k tokens), under SmallDoc, so the rules make it "whole", not "hybrid"; use 30 pages (11.7k tokens, 10 chunks) and assert the precondition
Found by Ornith in the p5b/02 session (it measured the document); my test's fault, not the task's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -126,7 +126,10 @@ func chatDoc(f *fakeDixie) string {
|
|||||||
func TestEmbeddingsAreCachedAcrossQuestions(t *testing.T) {
|
func TestEmbeddingsAreCachedAcrossQuestions(t *testing.T) {
|
||||||
f := newFakeDixie(t, false)
|
f := newFakeDixie(t, false)
|
||||||
e := f.engine(t, NewGate(2, 8, 5*time.Second), true)
|
e := f.engine(t, NewGate(2, 8, 5*time.Second), true)
|
||||||
doc := longDoc(12, 0) // ~12 pages, a few chunks: under EmbedSyncMax
|
doc := longDoc(30, 0) // ~11.5k tokens: over SmallDoc (so not "whole"), ~10 chunks: under EmbedSyncMax
|
||||||
|
if EstTokens(doc) <= SmallDoc {
|
||||||
|
t.Fatalf("test document is %d tokens; it must exceed SmallDoc (%d) to reach retrieval", EstTokens(doc), SmallDoc)
|
||||||
|
}
|
||||||
r := e.Run(context.Background(), doc, "which berth did the tug use?", "https://ex.test/a.pdf", dcache.ClassFleet)
|
r := e.Run(context.Background(), doc, "which berth did the tug use?", "https://ex.test/a.pdf", dcache.ClassFleet)
|
||||||
if r.Fallback != "" || r.Retrieval != "hybrid" {
|
if r.Fallback != "" || r.Retrieval != "hybrid" {
|
||||||
t.Fatalf("first question: fallback %q retrieval %q", r.Fallback, r.Retrieval)
|
t.Fatalf("first question: fallback %q retrieval %q", r.Fallback, r.Retrieval)
|
||||||
|
|||||||
Reference in New Issue
Block a user