Skip to content

fix: stabilize logaddexp expression evaluation - #6924

Open
primorLee wants to merge 2 commits into
Tencent:masterfrom
primorLee:codex/fix-expression-logaddexp-overflow
Open

fix: stabilize logaddexp expression evaluation#6924
primorLee wants to merge 2 commits into
Tencent:masterfrom
primorLee:codex/fix-expression-logaddexp-overflow

Conversation

@primorLee

@primorLee primorLee commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • evaluate expression logaddexp with the same numerically stable formulation used by the binary operator
  • preserve IEEE-754 behavior for equal positive/negative infinities and propagate NaN operands
  • classify non-finite values from their float bits so the checks remain valid in ncnn's Release build with -ffast-math
  • add regressions for large finite operands and both equal-infinity cases

Tests

  • Release build: cmake --build build-codex --target test_expression test_reshape test_crop test_interp -j 4
  • ctest --test-dir build-codex -R '^test_(expression|reshape|crop|interp)$' --output-on-failure (4 passed)
  • git diff --check

@tencent-adm

tencent-adm commented Aug 20, 2026

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

@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: 47569bf67c

ℹ️ 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/expression.cpp Outdated
@primorLee

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 55dc6a9642

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants