Skip to content

fix(docs): restore search and harden hot-path optimizations#371

Merged
cofin merged 4 commits intomainfrom
fix/docs-search
Feb 22, 2026
Merged

fix(docs): restore search and harden hot-path optimizations#371
cofin merged 4 commits intomainfrom
fix/docs-search

Conversation

@cofin
Copy link
Member

@cofin cofin commented Feb 22, 2026

Summary

  • Restore docs search: Remove unused sphinx_docsearch extension that disabled Sphinx's built-in search without ever having Algolia credentials configured — the deployed docs had zero search functionality
  • Fix broken changelog refs: Convert 4 dead :doc:/:ref: links in changelog.rst to plain text or valid targets
  • Harden hot-path optimizations from feat(performance): optimized hot path and add benchmarking scripts #368: Convert mutable sentinels to immutable tuples, remove unsafe SQLite cache write-back, narrow exception catch in sync fast path, remove primitive type coercion bypass

sphinx_docsearch disabled Sphinx's built-in search but Algolia
credentials were never configured, leaving the deployed docs with
no search functionality. Remove the extension and its dependency
to restore Shibuya's built-in client-side search.

Also fix 4 broken cross-references in changelog.rst that pointed
to non-existent guide directories.
- Convert shared mutable _EMPTY_DATA and _EMPTY_RESULT_DATA sentinels
  to immutable tuples, preventing global data leakage if consumers
  mutate result.data
- Remove unsafe write-back of column_names to shared CachedQuery in
  SQLite driver, eliminating TOCTOU race in multi-threaded usage
- Narrow exception catch in sync direct fast path from
  (AttributeError, NotImplementedError, TypeError) to
  (AttributeError, NotImplementedError) — TypeError from
  cursor.execute() indicates real parameter mismatches
- Remove _FAST_NO_COERCION_TYPES short-circuit that bypassed
  user-registered parent-class coercions for primitive types
Replace cryptic abbreviations with self-documenting names:
- _qc_* → _stmt_cache_* (query cache methods/attributes)
- _ps_pool → _processed_state_pool, _sql_pool → _statement_pool
- QC_MAX_SIZE → STMT_CACHE_MAX_SIZE
- _FAST_SCALAR_TYPES → _SCALAR_PASSTHROUGH_TYPES
- _COLUMN_NAME_CACHE_MAX_SIZE → COLUMN_CACHE_MAX_SIZE
- _ROW_METADATA_CACHE_MAX_SIZE → ROW_CACHE_MAX_SIZE
- _TWO_COLUMNS_FASTPATH → _TWO_COLUMN_THRESHOLD
- _EMPTY_DATA → _EMPTY_DML_DATA, _DEFAULT_METADATA → _DEFAULT_DML_METADATA
Replace tuple sentinels with inline empty lists for column_names,
inserted_ids, statement_results, and errors in FastDMLResult to fix
mypyc compilation — mypyc generates C struct slots typed as list, so
assigning tuples causes type errors during wheel builds.
@cofin cofin merged commit 1c9b19d into main Feb 22, 2026
16 checks passed
@cofin cofin deleted the fix/docs-search branch February 22, 2026 18:50
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