Skip to content

feat(stats/base/dists/f/pdf): add native C addon for evaluating the PDF#11201

Open
rautelaKamal wants to merge 1 commit intostdlib-js:developfrom
rautelaKamal:feat/stats-base-dists-f-pdf-c-port
Open

feat(stats/base/dists/f/pdf): add native C addon for evaluating the PDF#11201
rautelaKamal wants to merge 1 commit intostdlib-js:developfrom
rautelaKamal:feat/stats-base-dists-f-pdf-c-port

Conversation

@rautelaKamal
Copy link
Copy Markdown
Contributor

Resolves #{{TODO: add issue number or delete line if NA}}

Description

What is the purpose of this pull request?

This pull request:

  • Implements a native C-port for the F Distribution Probability Density Function (@stdlib/stats/base/dists/f/pdf).
  • Configures include.gypi, binding.gyp, and manifest.json dependencies via internal N-API mechanisms (STDLIB_MATH_BASE_NAPI_MODULE_DDD_D).
  • Validates identical sub-epsilon behavior to pure JS implementation across boundaries, limits, and NaN.
  • Introduces robust Boost and Julia test.native.js fixtures to validate the C-port accuracy and benchmarks it.

Related Issues

Does this pull request have any related issues?

This pull request has no related issues.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

This is a Proof of Concept submission towards my GSoC 2026 application regarding porting distributions and specific math functions to high-performance C native addons.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".


@stdlib-js/reviewers

This adds the missing C-port for the F Distribution Probability Density Function (PDF) taking advantage of standard base math dependencies over N-API.
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. labels Mar 29, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/f/pdf $\color{red}596/647$
$\color{green}+92.12%$
$\color{red}61/65$
$\color{green}+93.85%$
$\color{red}5/6$
$\color{green}+83.33%$
$\color{red}596/647$
$\color{green}+92.12%$

The above coverage report was generated for the changes in this PR.

@rautelaKamal
Copy link
Copy Markdown
Contributor Author

Just a quick heads up regarding the minor coverage drop flagged by Codecov:

The native.js file is showing 0% function coverage because the addon.node binary correctly skips compilation during the CI coverage step, which triggers the expected opts.skip = true fallback inside test.native.js. The math logic is fully tested and verified when the native addon actually builds!

Also, the drop in ibeta_power_terms.js relates to the original pure JavaScript implementations and was untouched in this PR. @Planeshifter

@github-actions github-actions bot mentioned this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants