Commit Graph
549 Commits
Author SHA1 Message Date
Dean 801d5b9bc1 Merge pull request #11344 from thuanquang/fix/commit-every-view-of-a-run
fix(libc): reset every page of a run view that Commit reprotects
2026-10-27 22:05:59 +13:00
Dean 3bed136010 Merge pull request #10574 from edubox/feat/libc-mtx-init-default-name
feat(libc): export _Mtx_init_with_default_name_override
2026-10-27 21:34:30 +13:00
Dean 77f68f314b Merge pull request #11560 from Ragbie/fix/write-after-read-update-stream
fix(libc): set up streams for writing after a read as FreeBSD does on Windows
2026-10-27 21:27:48 +13:00
Dean 8f255109ca Merge pull request #11400 from iAbdulrrahman/feat/libc-heapsort
feat(libc): implement heapsort
2026-10-27 21:25:09 +13:00
Dean e07c21ce68 Merge pull request #11157 from janzezno/feat/agc-frame-capture-linux
feat(agc): capture and replay frames on Linux
2026-10-27 21:20:55 +13:00
Dean 36e6c092c0 Merge pull request #9011 from JJenkx/perf/mapped-readable-run-lease-b5d763
perf(agc): lease mapped readable runs for import events
2026-10-27 21:05:23 +13:00
Dean 32906a0659 Merge pull request #11494 from iAbdulrrahman/feat/libc-bit-search-functions
feat(libc): implement ffs, ffsl, ffsll, fls and flsll bit search functions
2026-10-27 19:00:19 +13:00
Dean 940c298d51 Merge pull request #9698 from mazen320/feat/libc-num-put-vtable-size
fix(libc): size the num_put facet vtable to 112 bytes
2026-10-27 18:20:54 +13:00
Adrià 2e85f47aef Merge pull request #10659 from imellag/fix/libc-elf-pf-r-macos
fix(libc): define PF_R beside PF_X and PF_W for the macOS ELF types
2026-10-27 06:04:30 +01:00
Dean defd713929 Merge pull request #10788 from 00xDisaster/feat/libc-thread-gaps
feat(libc): implement _Thrd_lt
2026-10-27 14:59:56 +13:00
Dean 8cc3be6e2b Merge pull request #9098 from EagleBearerYS/perf/libc-collect-without-region-query
perf(libc): read private write watches per allocation without a region query
2026-10-27 14:57:16 +13:00
Dean c739a47136 Merge pull request #11289 from Danigamer05/feat/libc-unsigned-min64
feat(libc): implement unsigned 64-bit minimum
2026-10-27 11:06:32 +13:00
Dean b8265bf2bc Merge pull request #11241 from edubox/feat/libc-future-category
feat(libc): export the error_category members and std::future_error
2026-10-27 11:04:49 +13:00
Dean fc2594c7ac Merge pull request #11177 from orezraey/feat/libc-fe-dfl-env-measured-ps5
feat(libc): export __fe_dfl_env as measured on a PS5
2026-10-27 11:02:06 +13:00
Dean d6ac53ba34 Merge pull request #11054 from verusferro/feat/libc-num-put-do-put
feat(libc): format num_put<char>::do_put as the console's libc does
2026-10-27 11:00:12 +13:00
Dean 806a573b0b Merge pull request #10139 from dotaku22/feat/libc-fpurge
feat(libc): implement buffered stream purge
2026-10-27 10:53:27 +13:00
Dean c74530e615 Merge pull request #8903 from UnhealthyKraken/feat/libc-feraiseexcept
feat(libc): implement feraiseexcept
2026-10-27 10:52:51 +13:00
Dean e95e81d96a Merge pull request #11233 from edubox/feat/libc-setprecision
feat(libc): export std::setprecision(int)
2026-10-27 10:40:17 +13:00
Yunus Shaikh b1889783be feat(agc): fill the overlay's second page from the driver's counters
Page 2 now samples its sources once a second, in NotePresent, while it
shows; nothing of it runs while the overlay is hidden or on page 1.

- Busy share per queue worker, the top 5 phases in ms per frame and queue
  0's waits (memory, lock, GPU) come from the trace's per-thread totals.
  Showing page 2 turns recording on with buffering off, so a timed scope
  only adds to its thread's totals; leaving it turns recording off again.
  Toggle switches it under a mutex, and ANYPS5_OVERLAY=2 switches it on at
  start. An APS5_TRACE_* run keeps its own recording untouched, and page 2
  then shows these lines only while that trace records. A driver thread
  names itself when it starts (BindThread without APS5_TRACE_* stores the
  name only) and binds on its first timed scope while page 2 shows;
  unnamed threads are not bound.
- Render passes per frame: the draw path counts a begun pass in the trace
  totals while page 2's totals are on (PerformanceTrace::Count).
- Flips/s and the draw cache's hit rate come from the driver through a
  source it registers at start (the draw cache's lock is only tried); the
  pipeline store's hit rate from PipelineStoreTotals; the compile backlog
  from the shader preparation and library prebuild pools (tried locks).
- Dropped frames per second are the presents that found no free swapchain
  image; repeated ones are presents of the display buffer shown just before.
  The device passes the buffer's address, its present mode and the drops.
- Commit charge against the commit limit: GetPerformanceInfo on Windows,
  Committed_AS and CommitLimit from /proc/meminfo on Linux; page faults per
  second from PageFaultCount or getrusage.
- Host imports: their count and bytes against the budget, on devices that
  import host memory.
- CPU copies: address-based builds count the bytes they copy in a
  per-thread counter (a relaxed load and store, folded once a second) with
  the largest build of each second against the address-copy cap.
- Unimplemented-function calls: libc counts NotImplemented_nid_no_patch
  calls; refused shaders are the APS5_SKIP_REFUSED_DRAWS set's size.
- Title ID (when the title has a param.json) and present mode.

The tests cover the trace deltas, hit rates, present-mode names, the
/proc/meminfo parser and the OS reads, the per-thread copy counter's fold,
the counted unimplemented call, the trace switch with page 2 and lazy
binding without buffering, and on lavapipe the sampler end to end with a
fake driver source, its reset when page 2 is left, and the cost of a
present hidden, on page 1 and on page 2.
2026-10-26 20:42:29 +01:00
Evrim Cicek a7b52084ec fix(libc): set up streams for writing after a read as FreeBSD does on Windows
On Windows the UCRT drops a write that directly follows a read on an r+,
w+ or a+ stream: fputc and fprintf report success, fwrite returns 0 and
fputs returns EOF, all without the error indicator, and the file is left
unchanged, also after an fflush. On a stream open only for reading, fputc
after a read reports success as well.

Writes now first do what FreeBSD 11.4's __swsetup does: a stream open only
for reading fails with EBADF and sets the error indicator, and an update
stream that is reading drops its read buffer and ungetc data, clears end
of file and writes at the descriptor's offset. This covers fwrite, fputs,
fputc, putc_unlocked, fprintf, fprintf_s, fputwc, fputws, fwprintf,
fwprintf_s, puts and wprintf, and printf, vprintf and printf_s, which
write to standard output through PrintWindows and now return -1 there
instead of throwing.

Linux is unchanged: glibc writes at the stream position, which the libc
technical debt now records.
2026-10-26 21:53:56 +03:00
iAbdulrrahman 91d5a052b6 feat(libc): implement ffs, ffsl, ffsll, fls and flsll bit search functions 2026-10-26 20:30:27 +03:00
Adrià 39c801a13d Merge pull request #9669 from fogydes/feat/libkernel-exec-replacement
feat(libkernel): implement execv, execvp and execve process replacement
2026-10-26 16:36:56 +01:00
Adrià c4669c9ca2 Merge pull request #9958 from JJenkx/windows/printf-long-double-hex
fix(libc): format %La like titles' libc.prx does
2026-10-26 16:30:58 +01:00
janzezno c867473002 feat(agc): capture and replay frames on Linux 2026-10-26 16:11:45 +01:00
Dean bf77a9e9cb Merge pull request #10742 from 00xDisaster/feat/libc-lcosh
feat(libc): implement _LCosh and _LSinh
2026-10-27 02:28:15 +13:00
Adrià 1061954c7e Merge pull request #8520 from qpavyros/codex/app-archive-directories
feat(libkernel): enumerate archived app directories
2026-10-26 14:23:39 +01:00
Adrià FranchandClaude Sonnet 5.5 c2adff7598 fix(libc): export ExecutePermission_nid_no_patch with C linkage
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 14:18:34 +01:00
review 044e52a2f0 Merge commit 'refs/review/9669/head' into HEAD 2026-10-26 14:10:41 +01:00
JJenkxandClaude Opus 5.5 afa58432f3 fix(libc): format %La like titles' libc.prx does
A long double %La went to the host, which on Windows (MinGW) prints the
64-bit significand with its integer bit as the leading digit:
0xc.ccccccccccccccdp-7 for 0.1L. The libc.prx that titles ship
normalises it like a double, with a leading 1 and the remaining 63 bits
as 16 hexadecimal digits, 0x1.999999999999999ap-4, and rounds a shorter
precision half up with the carry kept in the leading digit. Share
HexFloat's digit and rounding code between double and long double and
use it for finite long double %a and %A in the narrow and wide families.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 08:52:35 -04:00
Maz 6bcafa52e0 fix(libc): declare shared vtable object with C linkage 2026-10-26 16:42:43 +04:00
Maz 13f46081e5 fix(libc): share num_put vtable slot count with GuestLocale 2026-10-26 16:42:43 +04:00
iAbdulrrahman 54fb58a5e4 feat(libc): implement heapsort 2026-10-26 14:34:19 +03:00
fogydes 719701a68e fix(libkernel): follow the measured exec lookup and image checks 2026-10-26 16:19:46 +05:30
thuanquangandClaude 2b640c8ad0 fix(libc): reset every page of a run view that Commit reprotects
Co-Authored-By: Claude <[email protected]>
2026-10-26 17:13:55 +07:00
Adrià FranchandClaude Sonnet 5.5 654eadd7f5 merge: sync archive directories with main
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 10:50:37 +01:00
GruzzberryandClaude Opus 5.5 d49b9b6f25 feat(libkernel_sys): implement setlogin
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 09:26:45 +00:00
Dean 8022d448e6 Merge pull request #10786 from 00xDisaster/feat/libc-dinkumware-math
feat(libc): implement _Exp and _FExp
2026-10-26 20:02:47 +13:00
Dean Galvin 92db947130 Merge branch 'main' into feat/libc-thread-gaps 2026-10-26 17:41:29 +13:00
Dean faa88a412b Merge pull request #10608 from edubox/feat/libc-underflow-error
feat(libc): export std::underflow_error type info, vtable and destructor
2026-10-26 14:40:05 +13:00
Adrià 97d33464c5 Merge pull request #9527 from AlxcBTW/pr/libc-annex-k-stream-io
feat(libc): add the Annex K stream printf, scanf and freopen_s functions
2026-10-26 01:21:26 +01:00
Adrià 898a7fef4f Merge pull request #9631 from UnhealthyKraken/feat/libc-fetch-seqcst
feat(libc): implement sequential bitwise fetch helpers
2026-10-26 01:11:55 +01:00
Danigamer05 94e88881d4 feat(libc): implement unsigned 64-bit minimum 2026-10-26 01:01:08 +01:00
Dean Galvin f4d5420b4b Merge branch 'main' into feat/libc-lcosh 2026-10-26 12:28:05 +13:00
qpavyros 6105be4431 merge: sync archive directories with main 2026-10-26 01:10:12 +02:00
Eduardo Ruiz e859215335 feat(libc): export the error_category members and std::future_error
The libc.prx bundled with PPSA02530 keeps error_code values in the second
dword: the shared error_category::default_error_condition shifts the value
into the high half and the equivalent overloads compare that dword and the
category. Export the type info, the base destructor and the three base
members, so titles that import them resolve to the same code the generic
and system category vtables already use.

future_category returns a static _Future_error_category derived from
_Generic_error_category and named "future". Its message maps 1..4 to
"broken promise", "future already retrieved", "promise already satisfied"
and "no state", and falls back to the generic table. future_error is 0x40
bytes: a GuestLocale::String at 0x8 and the 16-byte error_code at 0x30; its
0x30-byte vtable carries the console's _Doraise slot. _Throw_future_error
allocates that size and throws it with the console type info, and
_Rethrow_future_exception delegates to rethrow_exception.
2026-10-25 23:27:36 +01:00
Eduardo Ruiz 93b0c59870 feat(libc): export std::setprecision(int)
Dinkumware's setprecision returns the same two-register manipulator as setw: the function pointer in RAX and the precision value in RDX. The function stores the argument at ios_base offset 0x1c, leaving flags and width alone.

Disassembled from the libc.prx bundled in PPSA02530's sce_module, where _ZSt12setprecisioni (NID 1h8hFQghR7w) returns a pointer to 'mov %esi,0x1c(%rdi); ret' and has the same 10-byte export shape as _ZSt4setwi. Negative and zero values are stored unchanged; a null stream throws.
2026-10-25 23:19:11 +01:00
Dean 88f99678bf Merge pull request #10648 from edubox/feat/libc-pad-launch-attr
feat(libc): forward pthread attributes in _Pad::_Launch
2026-10-26 10:42:58 +13:00
Adrià 9c6d153dec Merge pull request #10419 from iamthehimansh/split/macos-build
build: compile FileStream, error categories, thread priority and two tests on macOS
2026-10-25 22:35:29 +01:00
Adrià a940685129 Merge pull request #9505 from EagleBearerYS/port/fable-shared-map-views
refactor(libc): map a run of shared guest pages as one view on Windows
2026-10-25 22:33:17 +01:00
Dean Galvin 4f5b9951c8 Merge branch 'main' into feat/libc-thread-gaps 2026-10-26 10:15:04 +13:00