Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/did/did_matlab_python_bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,23 @@ classes:
- name: database
type: class
matlab_path: "+did/database.m"
matlab_last_sync_hash: "bb39399"
matlab_last_sync_hash: "83a2bda"
status: ported
python_path: "did/database.py"
python_class: "Database"
inherits: "abc.ABC"
out_of_sync: false
decision_log: >
DID-matlab#229 (dae960b..83a2bda, 2026-10-24) made database.m's search
fast. search_doc_ids searches the terms of an AND in rank order (base.id
lookups, other terms, base.session_id, then the terms that test every
value) and checks each later term against the documents found so far;
ORed base.id lookups become one query (search_base_ids); and 'isa'
matches its regex against the distinct superclass lists only. All of it
relies on the doc_data indexes that sqlitedb creates (hasSearchIndexes).
In Python the SQL search is SQLiteDB's, not Database's, so the port is in
did/implementations/sqlitedb.py -- see the sqlitedb entry. Nothing
changes in did/database.py.
sync_notes: >
Schema validation was ported on 2026-08-28, closing what had been the
largest capability gap between the two languages. Python previously had
Expand Down
21 changes: 20 additions & 1 deletion src/did/did_matlab_python_bridge_implementations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,32 @@ classes:
- name: sqlitedb
type: class
matlab_path: "+did/+implementations/sqlitedb.m"
matlab_last_sync_hash: "bb39399"
matlab_last_sync_hash: "83a2bda"
status: ported
python_path: "did/implementations/sqlitedb.py"
python_class: "SQLiteDB"
inherits_matlab: "did.database"
inherits_python: "Database"
out_of_sync: false
decision_log: >
DID-matlab#229 (dae960b..83a2bda, 2026-10-24): fast id and isa searches,
ported to SQLiteDB (_search_doc_ids, _search_query_head,
_search_base_ids, _query_struct_to_sql_str, _ensure_indexes). MATLAB
adopted the index names Python already created -- doc_data_doc_idx ON
doc_data(doc_idx), doc_data_field_value ON doc_data(field_idx, value) --
so a database touched by both carries one copy of each. Both languages
now add them on open, leave a read-only file without them, and only then
(_search_indexes_ready / hasSearchIndexes) restrict terms to candidates,
collapse ORed base.id lookups, and match 'isa' against the distinct
superclass lists. Three deviations, none of which changes a result:
(1) Python also ranks the operations it brute-forces
(hasanysubfield_*, hassize, partial_struct) with regexp /
contains_string / hasmember as last-in-an-AND, since a brute-force term
loads every document it tests; (2) a brute-force term given candidates
loads only those documents (MATLAB has no brute-force path); (3) Python
applies negation as a complement in Python rather than in SQL, so a
negated term with candidates is the complement within the candidates
rather than within the branch -- the same set once intersected.
sync_notes: >
MATLAB 14439fb (2026-06-12, audit 6.1-3) added a private
escapeSqlLiteral() helper and applied it at the 14 sites where
Expand Down
Loading
Loading