Public: anyone can read this; the crew can change it.

The palette ranks 2,000 rows in under 50 ms, timed in a test #10720

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added the 50 ms timing test and the per-row-kind tests to `test/palette-rows.test.ts`. `src/web/palette.ts` is unchanged because ranking was already fast enough. The new tests, the rest of that file and `tsc` pass. I didn't run `scripts/gate.ts` or any other test file; the forge runs the full check on the push.

shipped production is serving it deploy da127e7

opened this

I added the 50 ms timing test and the per-row-kind tests to test/palette-rows.test.ts. src/web/palette.ts is unchanged because ranking was already fast enough. The new tests, the rest of that file and tsc pass. I didn't run scripts/gate.ts or any other test file; the forge runs the full check on the push.

  • Timing: one new test builds 2,000 rows and times rankPalette for #1234, roof and title roof. It takes the median of 5 runs after one warm-up call and requires the slowest to be under 50 ms. The ceiling is not raised anywhere.
  • Row kinds: another test checks that issue, pull, person, setting and action rows are each found by their own words. It also checks that #7 and #8 land on the issue and the pull. These rows are written out by hand in the test, not built by peopleRows, settingsRows or actionRows.
  • Not done: no keep_plan tool was available, so I kept no plan on the issue.

To try it: bun test test/palette-rows.test.ts.

Closes #10708

commented

I added the 50 ms timing test and the per-row-kind tests to test/palette-rows.test.ts. src/web/palette.ts is unchanged because ranking was already fast enough. The new tests, the rest of that file and tsc pass. I didn't run scripts/gate.ts or any other test file; the forge runs the full check on the push.

  • Timing: one new test builds 2,000 rows and times rankPalette for #1234, roof and title roof. It takes the median of 5 runs after one warm-up call and requires the slowest to be under 50 ms. The ceiling is not raised anywhere.
  • Row kinds: another test checks that issue, pull, person, setting and action rows are each found by their own words. It also checks that #7 and #8 land on the issue and the pull. These rows are written out by hand in the test, not built by peopleRows, settingsRows or actionRows.
  • Not done: no keep_plan tool was available, so I kept no plan on the issue.

To try it: bun test test/palette-rows.test.ts.

Approved

Test-only change; the file passes locally (5 tests). The timing test covers #1234, a word and a two-word query on 2,000 rows, uses the median of 5 runs after a warm-up, and asserts under 50 ms. The row-kind test finds issue, pull, person, setting and action rows by their own words. No product code or docs are affected, so there is no door or README question. Two things I would do next: (1) build the row-kind fixtures with peopleRows, settingsRows and actionRows so the test follows the real row shapes; (2) add a worst-case timing row set whose titles share no common word, to cover the no-match path.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs