Skip to content

fix(T13261): row-identity ref probe runs no JS hash per dangling ref - #1966

Open
kryptobaseddev wants to merge 1 commit into
mainfrom
fix/T13261-ref-probe-cost
Open

kryptobaseddev wants to merge 1 commit into
mainfrom
fix/T13261-ref-probe-cost

Conversation

@kryptobaseddev

Copy link
Copy Markdown
Owner

Summary

Fixes the review-hotfix LOW on #1888 (C1). On every fill-on open, rowIdentityFillPending's ref: probe evaluated storedRefSql, which for ac_text_hash calls the JS AC-text hash, on every NULL stored-ref row. A store with many legitimately dangling bindings paid one JS call per row on every open.

The probe now uses storedRefPresentSql, which is true exactly when storedRefSql would be non-NULL, in plain SQL:

  • text_hash: acTextHash returns non-NULL iff the criterion's text is a JS string, so the probe checks (SELECT typeof(text) …) = 'text'.
  • uid refs: refUidSql … IS NOT NULL, the same pure-SQL condition as before.

The fill pass still derives the values with storedRefSql.

Tests

row-identity-steady-open.test.ts adds a test for 40 bindings whose criterion is gone:

  • the probe reports nothing pending and calls the hash function 0 times; a counting re-registration proves this;
  • when the criterion appears, both ref: entries are reported;
  • after the pass, nothing is pending.

Mutation check: with the old probe restored, the test fails on 40 hash calls.

Results: the row-identity suite passes 122/122 and tsc -b packages/core is clean. Gate 38 (--base origin/main) and gate 32 (PR mode) pass.

Task: T13261

🤖 Generated with Claude Code

… ref (T13261)

The pending probe evaluated the AC text hash (a JS function) on every NULL
ac_text_hash row on every fill-on open. It now asks the same question in
SQL: the hash is non-NULL iff the criterion's text is a string
(typeof = 'text'). The fill pass is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant