TestResponseReserveScales pins the reserve curve: floored until ctxSize/8 crosses 8k, then linear. A divisor tweak lands here loud.
(t *testing.T)
| 609 | if Budget(1000) != 0 { |
| 610 | t.Fatal("budget must floor at 0") |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | // TestResponseReserveScales pins the reserve curve: floored until ctxSize/8 |
| 615 | // crosses 8k, then linear. A divisor tweak lands here loud. |
| 616 | func TestResponseReserveScales(t *testing.T) { |
| 617 | cases := []struct { |
| 618 | ctxSize int |
| 619 | want int |
| 620 | }{ |
| 621 | {32_768, 8000}, // floor: ctxSize/8 = 4096 < 8000 |
| 622 | {64_000, 8000}, // floor: ctxSize/8 = 8000, not > |
| 623 | {65_536, 8192}, // just above the floor |
| 624 | {128_000, 16_000}, // linear |
| 625 | {262_144, 32_768}, // common thinking-mode default |
| 626 | {1_000_000, 125_000}, |
| 627 | } |
| 628 | for _, c := range cases { |
| 629 | if got := ResponseReserve(c.ctxSize); got != c.want { |
| 630 | t.Errorf("ResponseReserve(%d) = %d, want %d", c.ctxSize, got, c.want) |
| 631 | } |
nothing calls this directly
no test coverage detected