fix(agc): keep capture trace output nonfatal #10760
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10760"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by lgqdaxia on 2026-10-24T23:06:07Z.
What
Capture tracing can throw when its 16 MiB pending queue fills, or stop the process when file output fails. This implements the drop-and-count policy requested in #10753.
capture-trace-dropped records=N; normal shutdown writescapture-trace-summary dropped=N. Accepted records and loss markers keep their order. After a drop, new records remain rejected until the next drain.This rebase resolves a context conflict in the technical-debt list and retains both the new upstream entry and this PR's trace-output limitation. The capture header, both C++ fixtures, failure wrapper and
tests/cmake/agc_capture_trace_tests.cmakeare byte-identical to previous published head6d26a5b8eb. All five topic commits are retained; the production behavior is unchanged. The AGC root CMake file and all upstream debt content are retained.AI-assisted: Codex
Tested
Current local validation is for head
b2ab7b2dc61b35a3b2db107341b3c4ef624fbe9d, based on maine53aff3f560e05730a608f7fb3084f2010abfacb.BUILD_TESTING=ON.tools/check_test_registration.pypasses, checking 1,694 test executables. Built all three capture-trace targets and their dependencies, including the project'slibc.public_headerspass (17/17), zero skipped. This includes host-runtime and project-runtime write/flush failure cases. Total CTest time was 44.42 s. This is a focused build/test run, not a full product build or complete CTest suite. These CPU fixtures do not initialize Vulkan; no GPU execution or performance result is claimed.6d26a5b8ebaa75a2e3c517c809ea045b1b6b47b4. Removing this PR's single trace-output debt entry reproduces main's debt file byte-for-byte. Conventions, whitespace checks and a merge-tree check against the stated main pass.The earlier isolated host-runtime comparison remains pinned to main
9fe758d7520eb0c33f3df8bef539064b40bd523fand head6d26a5b8eb: eight common capture tests passed 8/8 on each. That is historical comparison evidence, separate from the current configured project-runtime tests above.Historical hosted evidence remains pinned to its original versions: Build 40572948350 tested old head
c4ad483347merged into maind13b3d7c55. Both platforms built the product/libraries and passed all 16 capture tests. Linux recorded 2483 passed / 97 skipped; Windows recorded 1848 passed / 832 skipped / 1 failed (guest_raise_exception). The overall run failed.The independent Windows comparison and NVIDIA contributor report in this discussion also concern old head
c4ad483347. They are not new-head validation or full upstream CI approval. No full hosted CI, new Linux/macOS runtime, game capture, real SMB throughput or cancellation of permanently blocked native I/O is claimed for this rebase.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T23:13:38Z.
Review: CHANGES_REQUESTED
The happy-path backpressure test is useful, and I verified that the worker’s 100 ms timed wait drains a full queue even when it is below the normal 64 KiB notify threshold. I found an unhandled writer-error path in the new wait protocol:
run()swapspendingintobatchand notifiesspaceAvailable.pendingback to the limit.output.write()oroutput.flush()then throws, the catch callsstd::terminate()and the worker exits without notifyingspaceAvailableagain.The PR says file-write errors retain their existing behavior, but the new condition-variable wait adds a stranded-waiter case on that existing fatal path. Please either make writer failure a synchronized terminal predicate that wakes all waiters (and ensure shutdown handles it consistently), or demonstrate with a deterministic failing stream test that this state cannot occur. Please add a focused regression for writer failure; the current test only exercises a recovering sink. I have not modified your branch.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T23:43:45Z.
Review: APPROVED
Rechecked exact head
58afe4560099d805edf020ae603e84a5fec063d6. The added writer-failure tests address the stranded-producer concern: they fill the bounded queue, verify four producers remain blocked, then trigger both a short write and a failed flush through the productionCaptureTrace::run()catch and require the saved terminate handler to abort. The fixture distinguishes setup failure, watchdog exit, handler return, and the abort control result. The PR also clearly limits this evidence: the failure target uses the host C++ runtime; the separate probe with the project's Windows libc did not reach the catch, and that path is not claimed as covered.I independently compiled
CaptureTrace.cppandCaptureTraceFailure.cppfrom this exact head on Linux withg++ -std=c++20 -Wall -Wextra -Werror -pthread. Thequeue-backpressurecase passed, and the CMake failure harness passed bothwriteandflushmodes.tools/check_conventions.py --base upstream/main --head upstream/pr/10760andgit diff --checkpass. Hosted conventions and labels pass; the product build/test jobs are skipped by path filters, so I am not claiming hosted product coverage. The author reports the full Windows library/relinker builds and focused Windows suite in the PR description.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T21:38:48Z.
Review: APPROVED
Reviewed — looks good
The exact head bounds capture-trace queue growth, records losses in order, and disables tracing after output failures; the relevant focused tests are registered, and I found no blocking issue.
What I ran
Reviewed head
6d26a5b8ebaa75a2e3c517c809ea045b1b6b47b4. The PR's API base is684dfc1d561d09a8c35c7c153c95bcfed7e49896; a merge preview against currentmain6190e0efeb2e686e763a00518547b593f23ff163was clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ test binary was run locally.Results
tests/cmake/*.cmakeCMake glob and registers both executables; queue tests check bounds, loss counts, record ordering, recovery and shutdown.pr_abi_audit.pyandpr_test_quality.py; those two helper invocations failed to start. ABI auditing is not applicable to these non-export changes.Test-quality heuristic output
Sources
Not verified
I did not build locally or run the C++ tests, and did not independently verify Linux/macOS, GPU, or console behavior. The author-reported Windows and paired common-test results above remain unverified by me.