Skip to content

Accept scalar and array-like backend products#2550

Merged
FlorianPfaff merged 3 commits into
mainfrom
codex/pyrecest-scalar-dot-backend-20260606
Jun 7, 2026
Merged

Accept scalar and array-like backend products#2550
FlorianPfaff merged 3 commits into
mainfrom
codex/pyrecest-scalar-dot-backend-20260606

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

@FlorianPfaff FlorianPfaff commented Jun 6, 2026

Pull request

Summary

  • handle scalar operands in shared backend dot helpers by multiplying instead of using vector einsum paths
  • coerce array-like inputs for backend outer and matvec helpers
  • add backend contract coverage for scalar dot/outer and array-like dot/outer/matvec inputs
  • fix PyTorch dot scalar handling (0-D operands) to use multiplication before einsum/dot paths, resolving the CI failures in test_dot_accepts_scalar_operands

Checklist

  • Tests were added or updated.
  • Backend limitations were documented or added to src/pyrecest/_backend/capabilities.py.
  • Shape, dtype, and measurement-set conventions were checked against docs/conventions.md.
  • New user-facing failures use clear messages or shared exceptions from pyrecest.exceptions.
  • Public examples and docs were updated when relevant.
  • Performance-sensitive changes were checked against benchmarks/basic_regressions.py or a focused benchmark.
  • python scripts/check_release_consistency.py --local-only passes when release metadata changed.
  • The package smoke path still works: python -m build, twine check dist/*, install wheel, run a basic example.

@FlorianPfaff FlorianPfaff enabled auto-merge (squash) June 6, 2026 16:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 56.12s
✅ JSON prettier 7 0 0 0 0.9s
✅ JSON v8r 7 0 0 5.31s
✅ MARKDOWN markdownlint 68 0 0 0 1.89s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.67s
✅ PYTHON black 823 0 0 0 51.59s
✅ PYTHON isort 823 0 0 0 3.61s
✅ REPOSITORY checkov yes no no 45.93s
✅ REPOSITORY gitleaks yes no no 12.83s
✅ REPOSITORY git_diff yes no no 0.13s
✅ REPOSITORY secretlint yes no no 25.26s
✅ REPOSITORY syft yes no no 5.41s
✅ REPOSITORY trivy-sbom yes no no 7.67s
✅ REPOSITORY trufflehog yes no no 25.39s
✅ YAML prettier 11 0 0 0 0.79s
✅ YAML v8r 11 0 0 10.69s
✅ YAML yamllint 11 0 0 0.43s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff FlorianPfaff changed the title Accept scalar operands in backend dot Accept scalar and array-like backend products Jun 6, 2026
@FlorianPfaff
Copy link
Copy Markdown
Owner Author

@copilot Fix the CI/CD tests

auto-merge was automatically disabled June 6, 2026 19:04

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 6, 2026

@copilot Fix the CI/CD tests

Fixed in ca3eacb: I updated the PyTorch backend dot implementation to handle scalar operands via _torch.multiply before the einsum/dot paths, which addresses the failing CI tests (test_dot_accepts_scalar_operands).

@FlorianPfaff FlorianPfaff merged commit 83b4637 into main Jun 7, 2026
26 checks passed
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