Call for contributions: kernel, threads and memory (libkernel, libc, libSceUlt)

Đang mở
#698 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cmake, cpp, python
Lĩnh vực
backend, testing

Hướng nghiên cứu

Choose one function family from the listed paths under core/libs/prx/libkernel, libSceUlt, or libc; for silent stubs, start with docs/dev/debt/libkernel.md. Read the relevant implementation and the console-behaviour evidence, then add a guest test in core/libs/tests/Guest<Name>.cpp and register it in the library CMakeLists.txt. Run the named test with ctest; done means the chosen functions match the documented behaviour and any debt entry is updated.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: kernel enhancement help wanted medium

Call for contributions: kernel, threads and memory

Why

The CPU side of AnyKyty is AnyPS5's re-implementation of the PS5's system libraries. The kernel, the C library and the user-level threading library are what every title calls first, and a missing or approximate function there shows up as a hang or a crash far from its cause. Counted from the code (the library scanner in tools/progress.py, which scans APS5_VABI definitions; see the snippet below): libkernel has 754 implemented exports and 43 that still call NotImplemented_nid_no_patch; 19 more return success without doing anything. libc has 8 unimplemented and 16 inert. libSceUlt has 12 unimplemented. docs/dev/debt/libkernel.md lists 18 silent stubs with what the console does instead.

What to pick

Take one family, comment, and send one pull request per family:

  • Asynchronous I/O: sceKernelAioCancelRequest(s), sceKernelAioDeleteRequest(s), sceKernelAioPollRequests (core/libs/prx/libkernel/Aio/).
  • File events on kqueue: sceKernelAddFileEvent, sceKernelAddReadEvent, sceKernelAddWriteEvent, kevent (Equeue/).
  • Scheduling and affinity: cpuset_getaffinity, cpuset_setaffinity, cpuset_getid, rtprio_thread (Pthread/, System/).
  • Sockets: sendmsg, setsockopt, getsockopt (the _nid_postfix variants) (Socket/).
  • Thread factories in libSceUlt: the abstract, kernel and user-level thread factories (core/libs/prx/libSceUlt/).
  • C library: fopen, fopen_s, access, insque, remque, timespec_getres (core/libs/prx/libc/).
  • Silent stubs: turn an entry of docs/dev/debt/libkernel.md (for example the mutex protocol and priority-ceiling attributes) into real behaviour, or confirm in the entry how the console behaves.

The names come from the library scanner. The command line of tools/progress.py currently fails on AnyKyty because it also looks for the removed core/shader tree; this snippet runs only the library scan, from the repository root:

python3 - <<'PY'
import sys; sys.path.insert(0, "tools")
import progress
for g in progress.collect_libraries()["groups"]:
    if g["name"] in ("libkernel", "libc", "libSceUlt", "libSceSysmodule"):
        print(g["name"], "unimplemented:", g["todo_names"], "inert:", g["inert_names"])
PY
Expected result

For each function you take: the behaviour of the console (return values, errno, edge cases: null pointers, bad handles, zero sizes), implemented, with the debt entry removed or added through a fragment.

How to test without our games

Add a native guest test in core/libs/tests/Guest<Name>.cpp (about 1,700 exist; GuestKernelBarrierInitBounds.cpp is a short example) and register it in the library's CMakeLists.txt with add_test_executable. Run it with ctest --test-dir build -R <name> --output-on-failure. Tests call the exports through the same ABI wrappers a guest uses; no game is needed, and the CI runs them on Linux and Windows.

Difficulty

Medium for most; good first issue for the libc functions and for debt entries whose console behaviour is already written down.

Who to ask

Ask in this issue; the maintainers read every comment. Questions about the ABI wrappers and the NID tables are welcome too.

Rules that apply to every call
  • Comment on the issue before you start, so two people do not do the same work. One topic per pull request, against AnyKyty.
  • Conventional Commits (fix(libkernel): ..., feat(libScePad): ..., test(...), docs: ...). No comments in code. Nothing specific to one title: no title IDs, no data taken from a game, no per-title branches.
  • Every export either does exactly what it should or throws: an unimplemented export calls NotImplemented_nid_no_patch(__func__). A silent stub is allowed only when it unblocks a title and only affects the UI; list it under "Silent stubs" in the library's file in docs/dev/debt/ through a fragment (docs/dev/debt/changes/<branch>.md, see docs/dev/TechnicalDebt.md).
  • Say where a behaviour comes from: public SDK headers and documentation, a published reverse-engineering write-up, or your own analysis of your own console's system modules. Do not post or attach firmware files, system modules or game files.
  • Each test finishes in 30 s on the CI runners. python3 tools/check_conventions.py --base origin/AnyKyty must pass before you push.
  • Build and test: docs/dev/START_HERE.md and docs/dev/BUILD.md. CI runs the library tests on GitHub's runners (no GPU, no game) on Linux and Windows.
Ngôn ngữ chính
C++
Star
214
Fork
7
Merge trung bình
7 giờ 53 phút
Pull request đã merge (30 ngày)
280

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của simnJS/AnyPS5

Tất cả issue của simnJS/AnyPS5

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.