MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestResponseReserveScales

Function TestResponseReserveScales

internal/ctx/ctx_test.go:611–628  ·  view source on GitHub ↗

TestResponseReserveScales pins the reserve curve: floored until ctxSize/8 crosses 8k, then linear. A divisor tweak lands here loud.

(t *testing.T)

Source from the content-addressed store, hash-verified

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.
616func 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 }

Callers

nothing calls this directly

Calls 1

ResponseReserveFunction · 0.85

Tested by

no test coverage detected