Skip to content

feat(libkernel): always fire a socket read knote with NOTE_LOWAT below 1 - #14832

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
kallmek3nny:feat/libkernel-kevent-lowat-below-one
Nov 6, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
kallmek3nny:feat/libkernel-kevent-lowat-below-one

Conversation

@kallmek3nny

@kallmek3nny kallmek3nny commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What

A socket EVFILT_READ knote with NOTE_LOWAT and a mark below 1 threw NotImplemented_nid_no_patch. It now follows FreeBSD 11.4. filt_soread sets kn_data = sbavail(&so->so_rcv) - so->so_rcv.sb_ctl and, with NOTE_LOWAT, returns kn_data >= kn_sdata. sbavail returns a u_int (sockbuf.h), so the difference is unsigned and kn_data, an intptr_t (event.h), is never negative. A mark of 0 or below is therefore always met:

  • A level-triggered knote is reported at every kevent call, with data set to the queued bytes: 0 on an empty socket, without EV_EOF.
  • An EV_CLEAR knote is reported once when it is added and again after new data arrives, because kqueue_scan dequeues an EV_CLEAR knote after reporting it.
  • EV_ADD on an existing knote replaces the mark, as kqueue_register copies kev->data into kn_sdata for descriptor filters and then calls f_event. A drained socket re-added with -1 is reported (data 0); re-added with 1 it is not.
  • A listening socket ignores the mark: soo_kqfilter gives it filt_solisten, which has no NOTE_LOWAT handling.
  • An EVFILT_WRITE mark below 1 still throws. filt_sowrite compares sbspace, which can be negative, and returns 0 on an unconnected socket whose protocol requires a connection, so a write mark below 1 is not always met.

The kevent measurements entry in docs/dev/debt/libkernel.md (payload processes on a PS5, firmware 12.70) recorded the level-triggered stream-socket case as still throwing here: a mark of 0 on an empty Unix-domain stream socket gave a read event at once (data 0), and so did re-adding that knote with -1 once the socket was drained. This PR implements that behaviour and removes the clause from that entry (line 172). In the kevent entry (line 167), "Marks below 1 ... throw" now says a read mark below 1 is always met except on a listening socket, and a write mark below 1 throws. The EV_CLEAR and listening-socket cases are not measured on a PS5.

Code: DescriptorLowWater in Equeue/src/Kqueue.cpp throws for a mark below 1 only on EVFILT_WRITE. The new LowWaterAlwaysMet sets KernelEqueueEvent::lowWaterAlwaysMet when a knote is added and when EV_ADD changes an existing one. The level-triggered poll in Equeue/Equeue.cpp and PollEdge in Kqueue.cpp report a socket that the host does not report as readable when that flag is set and the socket is not listening, with data 0 and no EOF.

Tests in core/libs/tests/GuestKqueue.cpp:

  • LowWaterMarks: a mark of 0 on a stream socket with 4 queued bytes (data 4); a mark of 8 there (no event). On an idle stream socketpair: a mark of 0 (event, data 0, no EV_EOF), then 3 bytes sent (data 3), then a re-add with -1 after draining (data 0) and with 1 (no event).
  • EdgeTriggeredSocketRead: an EV_CLEAR knote with a mark of 0 gives one event with data 0 and none on the next call, then one with data 2 after 2 bytes are sent, then none.

Overlap: no open PR implements a read mark below 1. Open-PR searches for NOTE_LOWAT, low water, lowat and filt_soread return #7088, #7121, #9843 and #10645, and all four keep the throw or don't touch it.

Tested

Windows 11 Home 10.0.26300.9711, Git Bash, WinLibs gcc/g++, Ninja, Release. No title or homebrew; only the guest kqueue and public header tests were run.

  • Full build of this worktree at e450145140, before the branch was cut: git submodule update --init --recursive --jobs 8, cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_TESTING=ON -DPython3_EXECUTABLE=C:/Python314/python.exe, cmake --build build --parallel 4: exit 0.
  • On this branch (base f2d874c1fd), after the last edit: cmake --build build --target guest_kqueue_tests --parallel 4 rebuilt 11 libkernel objects, among them Equeue.cpp and Kqueue.cpp, and GuestKqueue.cpp, and relinked libkernel.prx and guest_kqueue_tests.exe: exit 0. ctest --test-dir build -R '^guest_kqueue$' --no-tests=error --output-on-failure --timeout 120: 1/1 passed (5.55 s).
  • After the commit f0a712175f: ctest --test-dir build -R '^guest_kqueue|public_headers' --no-tests=error --output-on-failure --timeout 120: 67/67 passed (public_headers, public_headers_compile_0 to _63, guest_kqueue, guest_kqueue_cleared_race).
  • python tools/check_conventions.py --base origin/main: exit 0, 0 errors and 2 debt-length warnings for docs/dev/debt/libkernel.md. Line 167 is 3622 characters (3537 on main) and line 172 is 4159 characters (4336 on main); both were already over 1000 characters on main.
  • python tools/pr_overlap.py --branch feat/libkernel-kevent-lowat-below-one: exit 2. It probed 2023 open PRs and fails closed when it cannot compare every one. The manual comparison is under What.
  • After b15b896411, which removes the Throws assertion for an EVFILT_WRITE mark of 0 from LowWaterMarks (the write path still throws in Kqueue.cpp, and no test pins it): cmake --build build --target guest_kqueue_tests --parallel 4: exit 0. ctest --test-dir build -R '^guest_kqueue' --output-on-failure: 2/2 passed (guest_kqueue, guest_kqueue_cleared_race). tools/check_conventions.py: exit 0, 0 errors and the same 2 debt-length warnings.

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: feat(equeue): implement macOS edge watches #12741
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks, the read side matches FreeBSD 11's filt_soread (with NOTE_LOWAT, a mark below 1 is always met once the EOF and error checks pass, and listening sockets ignore the mark) and the PS5 measurement already in the debt file, and the new empty-socket and re-add checks are useful. One request:

Please drop the new assertion at core/libs/tests/GuestKqueue.cpp:764, which requires EVFILT_WRITE with a NOTE_LOWAT mark of 0 to throw. That path is still unimplemented (core/libs/prx/libkernel/Equeue/src/Kqueue.cpp:170-171 calls NotImplemented_nid_no_patch), and tests check implemented behaviour or argument validation, never that an unimplemented call throws; implementing the write side later should not break this test. The read-side checks are good as they are, and removing the old read-side throw assertion was right.

Reviewed at f0a712175f.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

The low-water update matches the reviewed source and reported PS5 stream-socket behavior; I found no source blocker, and approval is withheld while the label check remains pending.

What I ran

Reviewed head f0a712175fbd7448827b6be896a521d4e36b5040 against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. The stack preview is clean against current main (e0caf1360035286bd22b9f2a3030e97b880ffb28). Environment: Linux x86_64, Debian 12, Python 3.11.2, Git 2.39.5. No build or C++ tests were run locally.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...f0a712175fbd7448827b6be896a521d4e36b5040
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14832
python3 tools/pr_stack_check.py 14832 --repo boykopovar/AnyPS5
gh pr checks 14832 --repo boykopovar/AnyPS5
# Read all five changed files and the pinned FreeBSD references in the PR description.

Results

Check Result Note
Diff whitespace passed No whitespace errors
Conventions passed Two existing debt-length warnings
Stack merge preview passed Clean against current main
Author-reported Windows build and tests not run Read from PR description only
Hosted Windows build passed Linux and specialized jobs skipped
Hosted label check not run Pending at review time
ABI and test-quality helpers not run Missing from isolated PR snapshot
Captured command output
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14832-f0a712175fbd/report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14832-f0a712175fbd/report.json
Conclusion: checks failed
conventions	pass	16s	https://github.com/boykopovar/AnyPS5/actions/runs/41341836824/job/124953317256
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341836892/job/124953317379
windows	pass	8m52s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950260026
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950261442
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950262057
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950261532
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950262271
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950262292
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950221556
intake	pass	20s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817453/job/124950221653
library-portability	pass	1m45s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817498/job/124950220434
report	pass	50s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817510/job/124950220441

Negative control

Not run locally. The PR reports the suite on Windows after the change, but no removed-fix variant was run as a negative control in this review.

Findings

Blocking

None found in the five changed files. The read-side flag is limited to open read sockets with NOTE_LOWAT below 1; edge-triggered modifications rearm the watcher, and listening sockets remain on their separate readiness path. The new tests cover level-triggered and EV_CLEAR cases.

Non-blocking

The PR reports a Windows 11 build and focused tests passing, including the added edge-triggered case; I did not rerun them. The labels check was pending, so this review does not approve the change yet.

Sources

Not verified

No local C++ build or runtime test was run. The Windows results and PS5 measurements were read from the PR description, not independently reproduced. Hosted Linux and specialized jobs were skipped, and the label check was still pending.

To get this to a good state

No source change is requested. Once the label check completes, I will refresh the exact head and required checks before deciding whether approval is appropriate.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4630 docs/dev/debt/libkernel.md
PR 5021 docs/dev/debt/libkernel.md
PR 6149 docs/dev/debt/libkernel.md
PR 6740 docs/dev/debt/libkernel.md
PR 6936 docs/dev/debt/libkernel.md
PR 7088 core/libs/prx/libkernel/Equeue/Equeue.hpp
core/libs/prx/libkernel/Equeue/src/Kqueue.cpp
core/libs/tests/GuestKqueue.cpp
docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 core/libs/prx/libkernel/Equeue/Equeue.hpp
core/libs/prx/libkernel/Equeue/src/Kqueue.cpp
core/libs/tests/GuestKqueue.cpp
docs/dev/debt/libkernel.md
PR 7135 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7447 docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7492 core/libs/prx/libkernel/Equeue/Equeue.cpp
core/libs/tests/GuestKqueue.cpp
PR 7532 docs/dev/debt/libkernel.md
PR 7565 docs/dev/debt/libkernel.md
PR 7804 docs/dev/debt/libkernel.md
PR 8497 docs/dev/debt/libkernel.md
PR 8605 docs/dev/debt/libkernel.md
PR 9156 docs/dev/debt/libkernel.md
PR 9199 docs/dev/debt/libkernel.md
PR 9242 docs/dev/debt/libkernel.md
PR 9293 core/libs/prx/libkernel/Equeue/Equeue.cpp
docs/dev/debt/libkernel.md
PR 9297 core/libs/prx/libkernel/Equeue/Equeue.cpp
docs/dev/debt/libkernel.md
PR 9302 core/libs/prx/libkernel/Equeue/Equeue.cpp
docs/dev/debt/libkernel.md
PR 9326 docs/dev/debt/libkernel.md
PR 9389 docs/dev/debt/libkernel.md
PR 9557 docs/dev/debt/libkernel.md
PR 9566 docs/dev/debt/libkernel.md
PR 9684 docs/dev/debt/libkernel.md
PR 9843 core/libs/prx/libkernel/Equeue/src/Kqueue.cpp
core/libs/tests/GuestKqueue.cpp
docs/dev/debt/libkernel.md
PR 9938 docs/dev/debt/libkernel.md
PR 9947 docs/dev/debt/libkernel.md
PR 10014 core/libs/tests/GuestKqueue.cpp
PR 10016 core/libs/tests/GuestKqueue.cpp
PR 10025 docs/dev/debt/libkernel.md
PR 10192 docs/dev/debt/libkernel.md
PR 10319 docs/dev/debt/libkernel.md
PR 10442 docs/dev/debt/libkernel.md
PR 10558 docs/dev/debt/libkernel.md
PR 10645 core/libs/prx/libkernel/Equeue/Equeue.cpp
docs/dev/debt/libkernel.md
PR 10749 docs/dev/debt/libkernel.md
PR 11002 docs/dev/debt/libkernel.md
PR 11215 docs/dev/debt/libkernel.md
PR 11219 docs/dev/debt/libkernel.md
PR 11223 docs/dev/debt/libkernel.md
PR 11247 docs/dev/debt/libkernel.md
PR 11624 docs/dev/debt/libkernel.md
PR 11625 docs/dev/debt/libkernel.md
PR 11628 docs/dev/debt/libkernel.md
PR 11661 docs/dev/debt/libkernel.md
PR 11689 docs/dev/debt/libkernel.md
PR 11698 docs/dev/debt/libkernel.md
PR 11896 docs/dev/debt/libkernel.md
PR 11939 docs/dev/debt/libkernel.md
PR 12104 docs/dev/debt/libkernel.md
PR 12170 docs/dev/debt/libkernel.md
PR 12560 docs/dev/debt/libkernel.md
PR 12682 docs/dev/debt/libkernel.md
PR 12688 docs/dev/debt/libkernel.md
PR 12700 docs/dev/debt/libkernel.md
PR 12854 docs/dev/debt/libkernel.md
PR 12965 docs/dev/debt/libkernel.md
PR 12970 docs/dev/debt/libkernel.md
PR 13336 docs/dev/debt/libkernel.md
PR 13504 docs/dev/debt/libkernel.md
PR 13506 docs/dev/debt/libkernel.md
PR 13560 docs/dev/debt/libkernel.md
PR 13582 docs/dev/debt/libkernel.md
PR 13587 docs/dev/debt/libkernel.md
PR 13695 docs/dev/debt/libkernel.md
PR 13950 docs/dev/debt/libkernel.md
PR 13953 docs/dev/debt/libkernel.md
PR 13964 docs/dev/debt/libkernel.md
PR 13995 docs/dev/debt/libkernel.md
PR 14039 docs/dev/debt/libkernel.md
PR 14043 docs/dev/debt/libkernel.md
PR 14085 docs/dev/debt/libkernel.md
PR 14103 docs/dev/debt/libkernel.md
PR 14105 docs/dev/debt/libkernel.md
PR 14108 docs/dev/debt/libkernel.md
PR 14111 docs/dev/debt/libkernel.md
PR 14128 docs/dev/debt/libkernel.md
PR 14183 docs/dev/debt/libkernel.md
PR 14190 docs/dev/debt/libkernel.md
PR 14206 docs/dev/debt/libkernel.md
PR 14212 docs/dev/debt/libkernel.md
PR 14264 docs/dev/debt/libkernel.md
PR 14310 docs/dev/debt/libkernel.md
PR 14320 docs/dev/debt/libkernel.md
PR 14324 docs/dev/debt/libkernel.md
PR 14325 docs/dev/debt/libkernel.md
PR 14417 docs/dev/debt/libkernel.md
PR 14493 docs/dev/debt/libkernel.md
PR 14497 docs/dev/debt/libkernel.md
PR 14710 docs/dev/debt/libkernel.md
PR 14875 docs/dev/debt/libkernel.md
PR 14876 docs/dev/debt/libkernel.md
PR 14885 docs/dev/debt/libkernel.md
PR 15030 docs/dev/debt/libkernel.md
PR 15035 docs/dev/debt/libkernel.md
PR 15037 docs/dev/debt/libkernel.md
PR 15040 docs/dev/debt/libkernel.md
PR 15041 docs/dev/debt/libkernel.md
PR 15064 docs/dev/debt/libkernel.md
PR 15095 docs/dev/debt/libkernel.md

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — hosted checks passed, approved

The exact head is unchanged, the pending labels check has passed, and the hosted Windows build and tests passed; my earlier full review found no blocking source issue.

What I ran

Rechecked head f0a712175fbd7448827b6be896a521d4e36b5040 against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 using GitHub’s live PR and check state. Environment: Debian 12 x86_64; no local build or compiler run.

gh api repos/boykopovar/AnyPS5/pulls/14832 --jq '{state:.state,head:.head.sha,base:.base.sha}'
gh pr checks 14832 --repo boykopovar/AnyPS5

Results

Check Result Note
Hosted Windows build and tests passed Completed on the reviewed head.
Conventions, intake, labels, report and portability passed Hosted checks completed successfully.
Linux and specialized jobs not applicable Skipped by workflow.
Local build or C++ tests not run No local compilation in this follow-up.
Captured hosted-check output
conventions	pass	16s	https://github.com/boykopovar/AnyPS5/actions/runs/41341836824/job/124953317256
labels	pass	9s	https://github.com/boykopovar/AnyPS5/actions/runs/41341836892/job/124953317379
windows	pass	8m52s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950260026
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950261442
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950262057
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950261532
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950262271
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950262292
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817511/job/124950221556
intake	pass	20s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817453/job/124950221653
library-portability	pass	1m45s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817498/job/124950220434
report	pass	50s	https://github.com/boykopovar/AnyPS5/actions/runs/41340817510/job/124950220441

Findings

Blocking

None found in the previously reviewed source.

Non-blocking

The source review and author-reported tests were not repeated in this CI-only follow-up.

Sources

Not verified

No local build, C++ tests, Linux/macOS test, console run or GPU behavior was performed in this follow-up. Linux and specialized hosted jobs were skipped.

To get this to a good state

No further action is needed for the reviewed head. If it changes, I will review the new head and its checks.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — same head, changes requested

I found two review blockers that were missed in my earlier approval: the new test pins an intentionally unimplemented write case, and the reported debt-file overlap with open PR #12741 has no declared landing order.

What I ran

Re-checked head f0a712175fbd7448827b6be896a521d4e36b5040 against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958; the head is unchanged. Linux x86_64; source, PR discussion and live overlap reports inspected. No build or tests were run for this corrective review.

gh api repos/boykopovar/AnyPS5/pulls/14832
gh api repos/boykopovar/AnyPS5/pulls/14832/files
gh api repos/boykopovar/AnyPS5/issues/14832/comments
gh api repos/boykopovar/AnyPS5/pulls/12741

Results

Check Result Note
Exact head and base passed Head unchanged
Test assertion failed Asserts an unimplemented path throws
Overlap coordination failed Open #12741 edits the same debt paragraph
Build and tests not run Corrective source review only

Findings

Blocking

  1. GuestKqueue.cpp asserts that EVFILT_WRITE with NOTE_LOWAT zero throws, while Kqueue.cpp deliberately leaves that behavior unimplemented through NotImplemented_nid_no_patch. This test would make a later implementation fail despite correct progress. Please remove this assertion or implement and test the write-side behavior in scope.
  2. The live overlap report confirms open PR #12741 also rewrites the docs/dev/debt/libkernel.md paragraph changed here. This PR's description acknowledges the shared line but says Depends on: none; repository contribution rules require agreeing the order with the other author and declaring that order. Please coordinate with #12741 and update the dependency/landing-order declaration accordingly.

Non-blocking

None.

Sources

Not verified

No build, test run, or console behavior was checked in this corrective pass. The earlier review's test evidence was supplied by the author, not run by me.

To get this to a good state

Remove the assertion for the intentionally unimplemented write path, and coordinate the shared debt-line landing order with #12741; I will re-check the changed head and rerun the applicable no-build checks.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head f0a7121 merged onto main f2d874c · tested 2026-11-01 19:58 UTC · 15 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,483 passed · 13 failed (0 new, 9 also fail on main, 4 unstable on main) · 56 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,552 of 3,168 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1017 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.6 s, ⚠️ agc_driver_graphics 120.2 s, ⚠️ agc_driver_graphics_maps_fallback 120.1 s, ⚠️ public_headers 63.2 s, ⚠️ agc_driver_sdwa_move_selectors 44.9 s
Unstable on main (4, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_job_manager_compute_capacity: failed in 4 of the last 5 main runs
agc_driver_pipeline_journal: failed in 3 of the last 5 main runs
agc_submit_progress: failed in 4 of the last 5 main runs
agc_submit_progress_no_timeline: failed in 4 of the last 5 main runs
Failing on main too (9, not counted against this PR)
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_idle_publish_wait
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (2, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_graphics: Timeout in the parallel run; also passed only on retry in 43 other runs in the last 7 days
agc_driver_graphics_maps_fallback: Timeout in the parallel run; also passed only on retry in 48 other runs in the last 7 days
Validation IDs already present on main (5 IDs in 556 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (556 tests): agc_driver, agc_driver_address_passes, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, and 548 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (56)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_pipeline_binary_vulkan: skipped, the device lacks VK_KHR_pipeline_binary
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platfor
Reproduce
git fetch origin f0a712175fbd7448827b6be896a521d4e36b5040 f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff f0a712175fbd7448827b6be896a521d4e36b5040
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@kallmek3nny

Copy link
Copy Markdown
Contributor Author

@SHOnnay this PR and #12741 both change the kqueue and kevent entry in docs/dev/debt/libkernel.md (L167 on main). #12741 changes "off Linux" to "on Windows" in that entry, and this PR rewrites its "Marks below 1 ... throw" clause. The edits don't overlap, but they are on the same line, so git merge-tree of 7298636d8e (#12741) and f0a712175f (this PR) finds one content conflict in that file. Nothing else conflicts.

#12741 was opened first, so I propose it merges first. This PR now declares Depends on: #12741. After #12741 merges, I'll rebase this one onto main and keep both edits to that line. If you'd rather this one went first, say so and I'll set it back to none.

@MarcZX10 b15b896411 removes the Throws assertion for an EVFILT_WRITE mark of 0 from LowWaterMarks. The write path still throws in Kqueue.cpp, but no test pins it now. guest_kqueue_tests builds, and ctest --test-dir build -R '^guest_kqueue' --output-on-failure passes 2/2 (guest_kqueue, guest_kqueue_cleared_race). The landing order with #12741 is above.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 2, 2026
@B-Howell

B-Howell commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

#12741, this PR's Depends on, merged at 13:39 UTC today, and that merge is what conflicts now. The only conflict is the kqueue and kevent debt entry: #12741 changed "off Linux" to "on Windows", and this PR rewrites the "Marks below 1 ... throw" clause of the same line. A word-by-word merge keeps both edits, and the code merges cleanly, so the rebase you planned is mechanical.

Head b15b896411 on main b28bb77217 with that resolution:

Rechecked on main a4eca2a056 (which has since merged #10014 and #13752): the same single conflict, the same resolution, and the Linux run still passes 3 of 3.

AI-assisted: yes (Claude Code)

@adriadam10 adriadam10 self-assigned this Nov 6, 2026
kenny solo and others added 2 commits November 6, 2026 21:48
A socket EVFILT_READ knote whose NOTE_LOWAT mark is below 1 is now always ready and reports the bytes in the receive buffer, 0 when it is empty, because FreeBSD 11.4 filt_soread returns kn_data >= kn_sdata and the bytes available are never negative. This holds for level-triggered and EV_CLEAR knotes and when EV_ADD changes the mark of an existing knote. A listening socket ignores the mark, as filt_solisten does. An EVFILT_WRITE mark below 1 still throws.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Kqueue.cpp deliberately leaves EVFILT_WRITE with NOTE_LOWAT below 1 unimplemented through NotImplemented_nid_no_patch, so LowWaterMarks no longer asserts that it throws. A later implementation of that path would otherwise fail the test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@adriadam10
adriadam10 force-pushed the feat/libkernel-kevent-lowat-below-one branch from b15b896 to 3f228ad Compare November 6, 2026 21:00
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@adriadam10
adriadam10 merged commit ba5db36 into boykopovar:main Nov 6, 2026
12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the read-side NOTE_LOWAT below 1 against FreeBSD 11.4 filt_soread/filt_solisten, the debt entries and the tests (the read throw assertion is replaced by value checks; the write-side assertion Dean asked to drop is gone). Rebased onto current main (adjacent edits in Kqueue.cpp from #9843 and in the libkernel debt file from #12741 and later, all kept); the guest kqueue tests passed on the rebase; merged.

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.

6 participants