Skip to content

fix: support both _init_elsdk.py and _elsdk_.py (irispython >= 3.4 rename)#59

Open
isc-tdyar wants to merge 12 commits intointersystems-community:mainfrom
isc-tdyar:fix/elsdk-rename-compat
Open

fix: support both _init_elsdk.py and _elsdk_.py (irispython >= 3.4 rename)#59
isc-tdyar wants to merge 12 commits intointersystems-community:mainfrom
isc-tdyar:fix/elsdk-rename-compat

Conversation

@isc-tdyar
Copy link
Copy Markdown
Contributor

Problem

_get_iris_dbapi_module() in iris_vector_rag/common/iris_dbapi_connector.py only searches for _init_elsdk.py. In intersystems-irispython >= 3.4 the file was renamed to _elsdk_.py. The search loop finds nothing, connect() is never injected, and all DBAPI connections return None.

Workaround (users can apply themselves):

IRIS_PKG=$(python3 -c "import iris; import os; print(os.path.dirname(iris.__file__))")
ln -sf "$IRIS_PKG/_elsdk_.py" "$IRIS_PKG/_init_elsdk.py"

Fix

Add an inner loop that checks both filenames for each search directory:

for candidate_name in ('_init_elsdk.py', '_elsdk_.py'):
    candidate_path = os_mod.path.join(search_dir, candidate_name)
    if os_mod.path.exists(candidate_path):
        init_elsdk_path = candidate_path

One inner for loop, no new logic. Backward-compatible — old packages (with _init_elsdk.py) still work; new packages (with _elsdk_.py) now work too.

Testing

Verified against intersystems-irispython 5.3.1 (which ships _elsdk_.py) on macOS ARM64 and Ubuntu ARM64.

isc-tdyar pushed a commit that referenced this pull request Mar 29, 2026
…uction-ready)

T001-T026 complete:
- scripts/setup_spike_env.sh + deploy_colbert_sp.sh
- iris_vector_rag/pipelines/colbert_iris/sp/ColBERTSearch.cls
  (Language=python SqlProc, Stage1 per-token centroid scan, Stage1.5
  DocCentroids IN-list, Stage 2 GROUP BY MAX VECTOR_DOT_PRODUCT, JSON return)
- PLAIDSearcher.search_via_sp() in plaid.py
- tests/colbert_iris/test_colbert_sp.py: 12 pass, 2 xfail
  xfail: test_search_via_sp_matches_search (overlap depends on K config)
  xfail: test_stage_timing_assertions (Stage2 1189ms > budget, K=64)
- PR #59 opened: intersystems-community/iris-vector-rag fix/_elsdk_-rename

Performance status — SP does NOT beat Phase 2 HNSW:
  Phase 2 HNSW: p50=391ms at T5K
  Phase 3 SP:   Stage2=1189ms at T5K (K=64, 400-doc batches)
  Root cause: Stage2 issues n_qtoks * ceil(n_candidates/400) SQL calls.
  Each GROUP BY MAX over 400 docs * 53 toks = 21K VECTOR_DOT_PRODUCT/call.

Next direction: iris-vector-graph globals-based approach.
  iris-vector-graph v1.19+ ships ^NKG integer-encoded inverted index.
  ^ColBERTIdx(centroid_id, doc_id) via iris.gref() = sub-1ms Stage1.5.
  But Stage2 remains the killer — needs a different architecture.
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.

2 participants