Skip to content

libkernel: wait tracing reports inactive sites with NaN averages #7155

Closed

Description

@Amoenus

Resolved — 4 November2026: #7156 merged as 5924ecf2dfa195608920b8beb90edd5a5d6a5b40 and closed this issue. The prior reproducer/evidence remains below. Current maintenance report; no new title-performance claim follows from the merge.

Current proposed correction -31October2026

#7156 remains open,Depends on:none. Refreshed/published head70f7250c3b95 incorporates main5857e2e98fda8af3a2ee61676bd40c8e97a8df1e with the identical one-line correction and preserved history. Main's newer TSC/timed-wait changes are retained.

Fresh13positive CPU processes and one intended control failure:literal main five shared synchronization checks,candidate the same five plus three trace passes;main-production plus identical trace fixture still emits inactivex0 rows,while candidate removes them and preserves active zero-durationx1. Maximum6.240s,no skips/timeouts;full native/relinker/real selected-fixture builds and conventions pass. Complete source/control evidence,logs,hashes and one inherited analyzer advisory.

Diagnostic correction only;no fresh title,performance,GPU or other-platform claim. Earlier evidence keeps its actual pins below. Keep open pending merge. AI-assisted:yes(Codex).

What

While investigating Sonic Unleashed Recompiled (PPSA99902) remaining at initial NOW LOADING (#3036), the existing APS5_TRACE_WAITS=1 diagnostic repeatedly reports inactive sites:

[waits] | cond <site> x0 0.0s (avg nan ms, max 0 ms, 0 timeouts, tid 0)

<site> replaces the caller offset. After each report, KernelTraceWait_nid_postfix resets counters but retains the sites. The next report copies zero-call sites into its ranked list and divides their zero duration by zero calls. They can also occupy the eight displayed slots.

Expected: omit sites with no calls in the reporting window; retain active sites even when their measured duration is zero. Current main 47a266cf975f00f7fba94013467d03bfa5e355e9 has this code.

Reproduction and validation

Test-only9b9eb47a31 leaves main production unchanged. Build guest_wait_trace_tests and run ctest --test-dir build -V -R '^guest_wait_trace$'. It creates eight sites, crosses two real three-second windows, then emits an active zero-duration wait. CTest rejects an inactive x0 row and requires the active zero-duration row. Expected failure3/3 on both Windows/GCC15.2r7 and Ubuntu24.04/GCC13.3.

Matched NVIDIA title profiles: original 120.790s has 39 reports / 38 NaN rows; corrected 120.872s has 39 reports / zero inactive or NaN rows. Only libkernel.prx changes; executable, guest module,126 other PRXs and dependencies match. Both reach their120s harness limit; original inputs/configuration remain unchanged. This is diagnostic validation, not a whole-main startup, performance or title-unblock claim. Wait tracing reports completed waits and does not exclude a blocked thread.

Proposed fix

Focused fork947e02f32b filters the temporary reporting vector before sorting/limiting it. One production line; regression and related synchronization controls pass. No change to wait/wake semantics. AI-assisted: yes, Codex; author responsible.

Activity

  1. MarcZX10 commented on Oct 18, 2026

    @MarcZX10
    Contributor

    I see the focused fork and regression fixture in the issue. Are you planning to open the PR yourself? I can review the branch or help validate it; I will not carry it as a separate submission while you are pursuing it.

  2. MarcZX10 commented on Oct 18, 2026

    @MarcZX10
    Contributor

    I see that #7156 is now open. I reviewed the current diff and left my review there: the filter only removes zero-call sites from the temporary report list, while active zero-duration waits remain visible. The focused regression and reported platform runs cover the issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions