fix(libc): fmodf leaves errno unchanged #4343

Closed
yeet227 wants to merge 1 commit from upstream-pr/4343 into main
yeet227 commented 2026-10-12 07:14:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by yeet227 on 2026-10-12T07:14:27Z.


What

Tested

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on:
  • AI-assisted:
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4826127104 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343). Originally posted by [yeet227](https://github.com/yeet227) on 2026-10-12T07:14:27Z. --- ### What ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [ ] Based on current `main`; no other open PR implements the same functions - [ ] One topic per PR; follow-ups go in a new PR - [ ] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [ ] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [ ] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [ ] New third-party code is a submodule built from source - [ ] Generic behaviour, not specific to one title - [ ] Depends on: <!-- #PR, or none --> - [x] AI-assisted: <!-- yes / no -->
MarcZX10 commented 2026-10-12 07:23:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T07:23:42Z.


I fetched the submitted head eb77849e54399e6752ad4205ddb0081406ebc573 and independently built guest_math_tests with GCC 12.2, Release/Ninja on Linux. CTest guest_math passed 1/1. The new fmodf errno preservation matches the existing fmod implementation. python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main...HEAD also pass. No title or Windows run was performed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119670400 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6119670400). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T07:23:42Z. --- I fetched the submitted head `eb77849e54399e6752ad4205ddb0081406ebc573` and independently built `guest_math_tests` with GCC 12.2, Release/Ninja on Linux. CTest `guest_math` passed 1/1. The new `fmodf` errno preservation matches the existing `fmod` implementation. `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main...HEAD` also pass. No title or Windows run was performed.
MarcZX10 commented 2026-10-12 07:25:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T07:25:19Z.


The latest conventions check for head eb77849e54399e6752ad4205ddb0081406ebc573 fails on PR metadata, not code: What and Tested are empty, checklist items remain unchecked, and Depends on / AI-assisted are unanswered. The job reports 12 findings. Please fill the template sections and check the applicable items; your description can include the Linux guest_math 1/1 result and note Windows/title testing was not run. The focused Linux test itself passed locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119694029 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6119694029). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T07:25:19Z. --- The latest conventions check for head `eb77849e54399e6752ad4205ddb0081406ebc573` fails on PR metadata, not code: `What` and `Tested` are empty, checklist items remain unchecked, and `Depends on` / `AI-assisted` are unanswered. The job reports 12 findings. Please fill the template sections and check the applicable items; your description can include the Linux `guest_math` 1/1 result and note Windows/title testing was not run. The focused Linux test itself passed locally.
github-actions[bot] commented 2026-10-12 07:32:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T07:32:45Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#3690 fmodf_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119799532 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6119799532). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T07:32:45Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3690 | | `fmodf_nid_postfix` | |
yeet227 commented 2026-10-12 07:33:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by yeet227 on 2026-10-12T07:33:39Z.


so how are we going to know which is best or are we going to test each branch

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119811827 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6119811827). Originally posted by [yeet227](https://github.com/yeet227) on 2026-10-12T07:33:39Z. --- so how are we going to know which is best or are we going to test each branch
MarcZX10 commented 2026-10-12 07:33:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T07:33:39Z.


One additional overlap point: open PR #3690 already wraps fmodf_nid_postfix in its FreeBSD math_errhandling errno-preservation change and includes fmodf coverage in CheckLibmErrnoPreserved. This PR adds the same errno behavior and focused checks for that export, so it appears redundant with #3690 rather than a separate uncovered behavior. Please coordinate with that PR author before proceeding; the broader #3690 change already carries this function.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119811863 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6119811863). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T07:33:39Z. --- One additional overlap point: open PR #3690 already wraps `fmodf_nid_postfix` in its FreeBSD `math_errhandling` errno-preservation change and includes `fmodf` coverage in `CheckLibmErrnoPreserved`. This PR adds the same errno behavior and focused checks for that export, so it appears redundant with #3690 rather than a separate uncovered behavior. Please coordinate with that PR author before proceeding; the broader #3690 change already carries this function.
MarcZX10 commented 2026-10-12 07:35:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T07:35:20Z.


I tested #4343’s guest_math case on Linux (1/1 passed), but we do not need to test two copies of the same behavior to choose between them. The diff and #3690 description show that #3690 already wraps fmodf_nid_postfix and tests errno preservation as part of the 39-function libm fix. Its current applicable CI checks pass and it is CLEAN; the full Linux/Windows suite jobs are skipped by repository policy. #4343 adds no distinct fmodf behavior, so I recommend coordinating the duplicate with #3690 rather than maintaining a second branch. If you intended a different contract, please point out that specific difference.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119834246 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6119834246). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T07:35:20Z. --- I tested #4343’s `guest_math` case on Linux (1/1 passed), but we do not need to test two copies of the same behavior to choose between them. The diff and #3690 description show that #3690 already wraps `fmodf_nid_postfix` and tests errno preservation as part of the 39-function libm fix. Its current applicable CI checks pass and it is CLEAN; the full Linux/Windows suite jobs are skipped by repository policy. #4343 adds no distinct `fmodf` behavior, so I recommend coordinating the duplicate with #3690 rather than maintaining a second branch. If you intended a different contract, please point out that specific difference.
MarcZX10 commented 2026-10-12 08:07:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T08:07:01Z.


The current conventions check is failing because the PR description still has the empty template: What and Tested are blank, and the checklist items are unchecked. Please fill those sections with the change and verification details, and mark the applicable checklist items before rerunning conventions.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120267001 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6120267001). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T08:07:01Z. --- The current conventions check is failing because the PR description still has the empty template: `What` and `Tested` are blank, and the checklist items are unchecked. Please fill those sections with the change and verification details, and mark the applicable checklist items before rerunning conventions.
oneandonlydean commented 2026-10-13 00:21:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:21:17Z.


Closing: #3690 already makes fmodf leave errno unchanged, with the other libm wrappers and a test for it, and the description here is still the empty template. Reopen if #3690 is closed without that change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135186932 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4343#issuecomment-6135186932). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T00:21:17Z. --- Closing: #3690 already makes `fmodf` leave errno unchanged, with the other libm wrappers and a test for it, and the description here is still the empty template. Reopen if #3690 is closed without that change.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4343
No description provided.