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.
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.
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]>
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.
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.