test(libSceLibreSsl3): drop unmeasured policy-flag throw assertions #14208

Merged
rooklz merged 1 commit from upstream-pr/14208 into main 2026-11-06 16:26:07 +00:00
rooklz commented 2026-10-31 23:33:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-31T23:33:07Z.


What

tests/X509VerifyParam.cpp pinned twelve policy-flag cases of X509_VERIFY_PARAM_set_flags_nid_postfix to a std::runtime_error with the parameter struct untouched. Those cases are the documented LibreSSL 2.5.4/4.0.0 divergence whose console behaviour is unmeasured, so they stand in for a result that is not modelled; per the project test rule, tests cover real behaviour and argument validation but do not assert unmodelled paths. This drops the CheckVersionDependent loop and its guard-check helper. CheckSetFlags (including every input where both LibreSSL versions agree) and the null-parameter std::invalid_argument case stay.

The branch keeps throwing through NotImplemented_nid_no_patch on that path, as on main: the call stays counted by NotImplementedCalls_nid_no_patch (the performance overlay metric), the export stays in the unimplemented list until the console's choice is measured, and docs/dev/debt/libSceLibreSsl3.md keeps recording the divergence. The earlier source and debt edits from review are reverted, so tools/progress.py is unchanged from main.

Tested

Host only; no console use.

  • cmake --build of a relinker-only Release configure (-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON): rc=0.
  • Built core/libs/prx/libSceLibreSsl3/tests/X509VerifyParam.cpp together with src/X509VerifyParam.cpp on the host and ran it: LibreSSL3 X509_VERIFY_PARAM tests passed.
  • A host harness that drives the policy branch with EXPLICIT_POLICY with no POLICY_CHECK confirms it throws std::runtime_error, leaves the parameter struct untouched, and increments the unimplemented-call counter by 1.
  • python3 tools/check_conventions.py --base origin/main: passed.
  • python3 tools/pr_overlap.py --branch fix/libressl3-set-flags-version-divergence: no shared files or exports with any open PR.

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 under Silent stubs in their library's technical debt file
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5102553088 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14208). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-31T23:33:07Z. --- ### What `tests/X509VerifyParam.cpp` pinned twelve policy-flag cases of `X509_VERIFY_PARAM_set_flags_nid_postfix` to a `std::runtime_error` with the parameter struct untouched. Those cases are the documented LibreSSL 2.5.4/4.0.0 divergence whose console behaviour is unmeasured, so they stand in for a result that is not modelled; per the project test rule, tests cover real behaviour and argument validation but do not assert unmodelled paths. This drops the `CheckVersionDependent` loop and its guard-check helper. `CheckSetFlags` (including every input where both LibreSSL versions agree) and the null-parameter `std::invalid_argument` case stay. The branch keeps throwing through `NotImplemented_nid_no_patch` on that path, as on `main`: the call stays counted by `NotImplementedCalls_nid_no_patch` (the performance overlay metric), the export stays in the unimplemented list until the console's choice is measured, and `docs/dev/debt/libSceLibreSsl3.md` keeps recording the divergence. The earlier source and debt edits from review are reverted, so `tools/progress.py` is unchanged from `main`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Host only; no console use. - `cmake --build` of a relinker-only Release configure (`-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`): rc=0. - Built `core/libs/prx/libSceLibreSsl3/tests/X509VerifyParam.cpp` together with `src/X509VerifyParam.cpp` on the host and ran it: `LibreSSL3 X509_VERIFY_PARAM tests passed`. - A host harness that drives the policy branch with `EXPLICIT_POLICY` with no `POLICY_CHECK` confirms it throws `std::runtime_error`, leaves the parameter struct untouched, and increments the unimplemented-call counter by 1. - `python3 tools/check_conventions.py --base origin/main`: passed. - `python3 tools/pr_overlap.py --branch fix/libressl3-set-flags-version-divergence`: no shared files or exports with any open PR. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-31 23:43:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T23:43:35Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The direct std::runtime_error bypasses the repository's unimplemented-call counter, so this still-unsupported policy path is omitted from the runtime performance overlay's usage metric.

What I ran

Reviewed head 0dc9ea6a30d9fb22e026fce5b2d2c80c6b758fd5 against base b08c539c505c48341146c705bc72d9b603cdb3a7; the merge preview was clean. Environment: Debian GNU/Linux 12, x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run.

git diff --check b08c539c505c48341146c705bc72d9b603cdb3a7...0dc9ea6a30d9fb22e026fce5b2d2c80c6b758fd5
python3 tools/check_conventions.py --base b08c539c505c48341146c705bc72d9b603cdb3a7 --head 0dc9ea6a30d9fb22e026fce5b2d2c80c6b758fd5 --title 'fix(libSceLibreSsl3): throw the documented set-flags policy rejection' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14208-0dc9ea6a30d9/pr-body.md
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14208
git show b08c539c505c48341146c705bc72d9b603cdb3a7:core/libs/prx/libc/src/General.cpp | nl -ba | sed -n '1016,1028p'
git show b08c539c505c48341146c705bc72d9b603cdb3a7:core/libs/prx/libSceAgcDriver/Execution/src/PerformanceOverlay.cpp | nl -ba | sed -n '919,931p'
git show b08c539c505c48341146c705bc72d9b603cdb3a7:core/libs/prx/libSceAgcDriver/tests/PerformanceOverlayStatistics.cpp | nl -ba | sed -n '783,795p'

Results

Check Result
Diff check Passed
Conventions and PR template Passed
Current-base merge preview Clean; no declared dependencies
Targeted source inspection Confirmed NotImplemented_nid_no_patch increments the counter; the overlay reads it and an existing test checks that behavior
Precheck Exact head/base remained unchanged; the ABI and test-quality helper steps could not run because those helper files are absent from the PR snapshot. They are not material to this source-only change.
Hosted CI Intake, labels, eligibility, conventions, library-portability and report were queued at final refresh
Unedited output
All conventions checks passed.
extern "C" [[noreturn]] void NotImplemented_nid_no_patch(const char* funcName) {
    notImplementedCalls.fetch_add(1, std::memory_order_relaxed);
    throw std::runtime_error(std::string(funcName) + " not implemented");
}
now.unimplemented = NotImplementedCalls_nid_no_patch();
require(NotImplementedCalls_nid_no_patch() == before + 1, "an unimplemented-function call is not counted");

Findings

Blocking

The changed branch handles an unmeasured policy case by throwing directly, bypassing NotImplemented_nid_no_patch. That helper increments NotImplementedCalls_nid_no_patch; the performance overlay displays this count, and the existing PerformanceOverlayStatistics test asserts that unsupported calls increment it. As written, this path continues to reject the operation but is no longer counted, producing incomplete runtime diagnostics.

Minimal fix: preserve the counter update for this unsupported path. Calling the existing helper is sufficient if its standard message is acceptable; otherwise route the custom rejection through a helper that increments the same counter before throwing.

        NotImplemented_nid_no_patch(__func__);

Non-blocking: None.

Sources

Not verified

  • A build or C++ test run; the initial review workflow avoids build-dependent checks.
  • Console behavior for the policy-variable case.

To get this to a good state

Preserve the counter behavior while keeping the policy rejection. I will rerun the same relevant checks on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5725486716 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14208#pullrequestreview-5725486716). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T23:43:35Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The direct `std::runtime_error` bypasses the repository's unimplemented-call counter, so this still-unsupported policy path is omitted from the runtime performance overlay's usage metric. ## What I ran Reviewed head `0dc9ea6a30d9fb22e026fce5b2d2c80c6b758fd5` against base `b08c539c505c48341146c705bc72d9b603cdb3a7`; the merge preview was clean. Environment: Debian GNU/Linux 12, x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run. ```sh git diff --check b08c539c505c48341146c705bc72d9b603cdb3a7...0dc9ea6a30d9fb22e026fce5b2d2c80c6b758fd5 python3 tools/check_conventions.py --base b08c539c505c48341146c705bc72d9b603cdb3a7 --head 0dc9ea6a30d9fb22e026fce5b2d2c80c6b758fd5 --title 'fix(libSceLibreSsl3): throw the documented set-flags policy rejection' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14208-0dc9ea6a30d9/pr-body.md python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14208 git show b08c539c505c48341146c705bc72d9b603cdb3a7:core/libs/prx/libc/src/General.cpp | nl -ba | sed -n '1016,1028p' git show b08c539c505c48341146c705bc72d9b603cdb3a7:core/libs/prx/libSceAgcDriver/Execution/src/PerformanceOverlay.cpp | nl -ba | sed -n '919,931p' git show b08c539c505c48341146c705bc72d9b603cdb3a7:core/libs/prx/libSceAgcDriver/tests/PerformanceOverlayStatistics.cpp | nl -ba | sed -n '783,795p' ``` ## Results | Check | Result | |---|---| | Diff check | Passed | | Conventions and PR template | Passed | | Current-base merge preview | Clean; no declared dependencies | | Targeted source inspection | Confirmed `NotImplemented_nid_no_patch` increments the counter; the overlay reads it and an existing test checks that behavior | | Precheck | Exact head/base remained unchanged; the ABI and test-quality helper steps could not run because those helper files are absent from the PR snapshot. They are not material to this source-only change. | | Hosted CI | Intake, labels, eligibility, conventions, library-portability and report were queued at final refresh | <details><summary>Unedited output</summary> ```text All conventions checks passed. ``` ```text extern "C" [[noreturn]] void NotImplemented_nid_no_patch(const char* funcName) { notImplementedCalls.fetch_add(1, std::memory_order_relaxed); throw std::runtime_error(std::string(funcName) + " not implemented"); } ``` ```text now.unimplemented = NotImplementedCalls_nid_no_patch(); ``` ```text require(NotImplementedCalls_nid_no_patch() == before + 1, "an unimplemented-function call is not counted"); ``` </details> ## Findings **Blocking** The changed branch handles an unmeasured policy case by throwing directly, bypassing `NotImplemented_nid_no_patch`. That helper increments `NotImplementedCalls_nid_no_patch`; the performance overlay displays this count, and the existing `PerformanceOverlayStatistics` test asserts that unsupported calls increment it. As written, this path continues to reject the operation but is no longer counted, producing incomplete runtime diagnostics. Minimal fix: preserve the counter update for this unsupported path. Calling the existing helper is sufficient if its standard message is acceptable; otherwise route the custom rejection through a helper that increments the same counter before throwing. ```suggestion NotImplemented_nid_no_patch(__func__); ``` **Non-blocking:** None. ## Sources - [Changed rejection path at reviewed head](https://github.com/boykopovar/AnyPS5/blob/0dc9ea6a30d9fb22e026fce5b2d2c80c6b758fd5/core/libs/prx/libSceLibreSsl3/src/X509VerifyParam.cpp#L23-L26) - [Counter increment at base](https://github.com/boykopovar/AnyPS5/blob/b08c539c505c48341146c705bc72d9b603cdb3a7/core/libs/prx/libc/src/General.cpp#L1020-L1026) - [Performance overlay reads the counter at base](https://github.com/boykopovar/AnyPS5/blob/b08c539c505c48341146c705bc72d9b603cdb3a7/core/libs/prx/libSceAgcDriver/Execution/src/PerformanceOverlay.cpp#L919-L927) - [Existing counter assertion at base](https://github.com/boykopovar/AnyPS5/blob/b08c539c505c48341146c705bc72d9b603cdb3a7/core/libs/prx/libSceAgcDriver/tests/PerformanceOverlayStatistics.cpp#L786-L793) ## Not verified - A build or C++ test run; the initial review workflow avoids build-dependent checks. - Console behavior for the policy-variable case. ## To get this to a good state Preserve the counter behavior while keeping the policy rejection. I will rerun the same relevant checks on the updated head.
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!14208
No description provided.