Skip to content

Validate Autograd multinomial pvals#3212

Closed
FlorianPfaff wants to merge 6 commits into
mainfrom
fix-autograd-multinomial-pvals
Closed

Validate Autograd multinomial pvals#3212
FlorianPfaff wants to merge 6 commits into
mainfrom
fix-autograd-multinomial-pvals

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • stop re-exporting the Autograd backend's raw multinomial sampler directly
  • validate pvals before dispatch so non-real probability vectors fail with a clear TypeError
  • add focused Autograd backend regression coverage

Bug fixed

The Autograd backend still exposed autograd.numpy.random.multinomial without the probability validation added for the NumPy backend. Inputs with non-real probability dtypes could therefore be passed through to the low-level sampler instead of being rejected consistently by PyRecEst's backend contract.

Validation

  • Syntax-checked the modified source and new test file with ast.parse locally.
  • Full pytest was not run locally because the sandbox cannot resolve github.com to clone/install the repository dependency set.

@FlorianPfaff FlorianPfaff enabled auto-merge (squash) June 27, 2026 08:11
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 73.52s
✅ JSON prettier 7 0 0 0 0.87s
✅ JSON v8r 7 0 0 5.15s
✅ MARKDOWN markdownlint 68 0 0 0 2.16s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 1.18s
✅ PYTHON black 1040 43 0 0 67.12s
✅ PYTHON isort 1040 64 0 0 4.74s
✅ REPOSITORY checkov yes no no 51.23s
✅ REPOSITORY gitleaks yes no no 6.87s
✅ REPOSITORY git_diff yes no no 0.1s
✅ REPOSITORY secretlint yes no no 28.36s
✅ REPOSITORY syft yes no no 3.19s
✅ REPOSITORY trivy-sbom yes no no 9.12s
✅ REPOSITORY trufflehog yes no no 25.53s
✅ YAML prettier 11 0 0 0 0.72s
✅ YAML v8r 11 0 0 11.21s
✅ YAML yamllint 11 0 0 0.61s

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

Copy link
Copy Markdown
Owner Author

Closing as superseded by the newer active multinomial probability-validation work in #3220, which covers JAX and PyTorch as well.

auto-merge was automatically disabled June 27, 2026 09:08

Pull request was closed

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