Skip to content

Make rctd-rust pip-installable - #1

Merged
LCGaoZzz merged 1 commit into
mainfrom
feat/installable-package
Aug 13, 2026
Merged

Make rctd-rust pip-installable#1
LCGaoZzz merged 1 commit into
mainfrom
feat/installable-package

Conversation

@LCGaoZzz

Copy link
Copy Markdown
Owner

Summary

  • package the validated Rust/Rayon backend with PyO3 and Maturin
  • expose a drop-in rctd_rust.run_rctd API pinned to rctd-py==0.3.7
  • add installation, quick-start, modes, cache/thread, provenance, and troubleshooting documentation
  • add Windows wheel CI plus cross-platform GitHub Release wheel automation
  • add a frozen synthetic-fixture correctness gate

Verification

  • cargo check --locked --manifest-path work/variants/rctd_rs/Cargo.toml
  • cargo test --locked --manifest-path work/variants/rctd_rs/Cargo.toml
  • built cp310-abi3-win_amd64 wheel and source distribution
  • installed the wheel with all dependencies in a clean Python 3.12 environment
  • rebuilt and imported the native module from the source distribution
  • pytest -q: 3 passed
  • frozen gate: minimum Pearson 0.999999999998, weights max diff 1.447e-6, doublet max diff 3.061e-8, labels identical
  • staged secret/path scan: clean

@LCGaoZzz
LCGaoZzz merged commit d2c29a0 into main Aug 13, 2026
2 checks passed
@LCGaoZzz
LCGaoZzz deleted the feat/installable-package branch August 13, 2026 10:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e64b4d95cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/rctd_rust/_backend.py
sq_ptrs[index] = sq_keep[index].ctypes.data
sigma_values = np.ascontiguousarray(SIGMA_ALL, dtype=np.int64)
result = ctypes.c_int64(-1)
_LIB.choose_sigma_full2(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the million-element sigma subsample

When N_fit * number_of_reg_genes exceeds 1,000,000, this unconditional native call scores every element, whereas the pinned upstream choose_sigma randomly selects exactly one million elements before evaluating candidate likelihoods. Because choose_sigma_full2 has no equivalent subsampling branch, large experiments can select a different sigma and produce different downstream results despite the advertised drop-in behavior; preserve the upstream sample or fall back for this case.

Useful? React with 👍 / 👎.

Comment thread src/rctd_rust/_backend.py
Comment on lines +337 to +339
user_classes = config.class_df
class_by_type = ({name: name for name in cell_type_names} if user_classes is None else user_classes)
classes = np.array([class_by_type[name] for name in cell_type_names])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject null class mappings before classification

When an explicit class_df contains a None or NaN value, these lines accept the null as a legitimate class label, which changes the same-class comparisons and can silently produce incorrect doublet classifications and class-name outputs. The pinned upstream implementation explicitly rejects these mappings with ValueError, so retain that validation before running the native fits.

Useful? React with 👍 / 👎.

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