Commit Graph
14017 Commits
Author SHA1 Message Date
akkadbakkad89andDevin a7da412a71 fix(libkernel): follow kqueue_register for EV_FORCEONESHOT and modify flags
On a new knote EV_FORCEONESHOT is dropped from the flags; on an
existing one it sets EV_ONESHOT and fires the knote, as
kqueue_register does at l.1339-1341. A modify no longer ORs
EV_ONESHOT, EV_CLEAR or EV_DISPATCH into the knote.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-15 06:01:06 +00:00
akkadbakkad89andDevin b32c5a50cd feat(libkernel): implement kevent EV_DISABLE, EV_DISPATCH and EV_FORCEONESHOT
A knote registered or modified with EV_DISABLE stays registered but is
not polled, fired or reported until an EV_ENABLE change re-arms it, as
kern_event.c does with KN_DISABLED. EV_DISPATCH reports an event once
and then disables the knote, and EV_FORCEONESHOT registers as oneshot.
A negative nevents fails with EINVAL instead of throwing.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-15 06:00:43 +00:00
alfalfa-starandClaude Opus 5.5 56d8b4f68d feat(npmanager): implement sceNpGetUserIdByAccountId
Account id 0 or a null output returns SCE_NP_ERROR_INVALID_ARGUMENT;
otherwise the always signed-out NP returns SCE_NP_ERROR_SIGNED_OUT, as
sceNpGetAccountIdA does. PPSA14632 imports it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 08:00:31 +02:00
David f1735f59f7 refactor(relinker): grow a moved branch's displacement with resize
With the GS traps in WindowsTlsBuilder::Build, GCC 15.2 inlines this
vector insert differently and reports eight -Wstringop-overflow false
positives at it. resize appends the same four zero bytes and builds without
them.
2026-10-15 09:52:37 +04:00
ArjenS-LA 1800d3892b fix(relinker): allow explicit module directories without standard folders 2026-10-14 22:51:15 -07:00
JJenkx a38314933d test(relinker): provide libkernel host fixture for deferred dependencies 2026-10-15 01:41:59 -04:00
JJenkx d94000a096 fix(relinker): load guest providers used by executable imports 2026-10-15 01:40:33 -04:00
JJenkx 39ba223bdd fix(relinker): defer runtime-only guest dependencies 2026-10-15 01:40:33 -04:00
Yunus Shaikh 62022e9362 refactor(agc): keep the private heap lookup and expose a public wrapper
LargestDeviceLocalHeap now calls ShaderResources.cpp's private
largestDeviceLocalHeap instead of replacing it, so the file's callers
stay as they are on main and other changes that call the private helper
still build with this one.
2026-10-14 22:38:16 -07:00
Rujul Talekar 3dffc8ca9e fix(libc): give collate<wchar_t> its own 16-bit vtable 2026-10-15 11:07:58 +05:30
fogydes 65ba674e1b test(relinker): cover negative wrapped pointer rejection with matching FDE segment 2026-10-15 10:53:35 +05:30
fogydes e692264e16 fix(relinker): limit relative unwind pointer overflow check to signed encodings 2026-10-15 10:53:18 +05:30
fogydes 7ffb6713c9 fix(relinker): guard against address underflow in encoded unwind pointers and reject zero FDE CIE offset 2026-10-15 10:53:18 +05:30
Agnibha Mukherjee 8e5073ebe8 fix(relinker): rebase the relocated program header table at a fixed Linux base 2026-10-15 10:32:57 +05:30
Romans Pokrovskis 82b4a665fa test(agc): honor the GPU selector in recorder fixtures 2026-10-15 07:43:41 +03:00
David 03c09c4598 docs(debt): record where the uname sysctl strings come from 2026-10-15 08:38:54 +04:00
David 8cda5ec0a1 test(libkernel): cover the uname names through sysctlbyname and sysctlnametomib 2026-10-15 08:38:54 +04:00
David 0bd254fafd feat(libkernel): accept the uname names in sysctlbyname and sysctlnametomib
Both map kern.ostype, kern.osrelease, kern.version, kern.hostname and hw.machine to their MIBs, as they do for the other names sysctl serves.
2026-10-15 08:38:53 +04:00
David 364f9749b7 test(libkernel): cover the uname names through sysctl
For each of the five: the size query, the value, a short buffer (ENOMEM, the copied prefix kept), a new value (EPERM) and a trailing name component (ENOTDIR).
2026-10-15 08:38:52 +04:00
David 0b058c88a7 feat(libkernel): answer the uname sysctl names
uname reads kern.ostype, kern.hostname, kern.osrelease, kern.version and
hw.machine through sysctl. Super Mario Sunshine (PPSA99312) stopped on the
first, "sysctl_nid_postfix: unsupported MIB 1.1". sysctl now serves the five
as read-only strings: FreeBSD 11.4-RELEASE's values for the type, release and
version, the host name gethostname reports, and amd64. A new value returns
EPERM as for the other read-only names, and a trailing name component returns
ENOTDIR.
2026-10-15 08:25:01 +04:00
Dean d92a8dad39 Merge pull request #1189 from MichonGoddijn231849/fix/cb-resolve-tiled-targets
fix(agc): CB resolve into any tiled color target
2026-10-15 17:15:57 +13:00
Celegans12 625525de79 fix(libSceNetCtl): answer the DHCP host name, PPPoE name and proxy server as empty strings
Since #5056, sceNetCtlGetInfo throws for every info code it does not
model. Ghost of Yotei (PPSA26344) asks for code 12, the DHCP host name,
during boot and now aborts one second in.

The configuration #5056 reports (wired, DHCP, HTTP proxy off) sets no
DHCP host name, no PPPoE user name and no proxy server, so codes 12, 13
and 20 now return 0 with an empty string. The Wi-Fi codes (5-10) and
the proxy port (21) still throw. GuestNetCtl checks the three empty
answers and keeps the throw check for the rest; the libSceNetCtl debt
line says the same.
2026-10-15 06:00:49 +02:00
Yunus Shaikh 43855cb5e8 test(shader): cover selected image table records and their fallbacks
agc_shader_memory and agc_shader_bindless: an invalid selected T# is
poisoned with its words without changing the artifact; a key past the
heap selects a null image without reading the heap; an unmapped selected
record is Unmapped poison and is not read; a key loaded from a constant
buffer at an SRT offset selects its record, and one that cannot be read
faults the table instead of throwing; a key loaded from a buffer the
shader writes keeps the whole table; a key chosen per lane keeps the
table; a record past the 65,536-key cap is selected; and a selected
record whose second load carries past 32 bits is OffsetCarry poison while
the record past the wrap is read.

agc_driver_image_table: a dispatch keyed from a constant buffer at an SRT
offset samples three records exactly as their direct bindings do, with
one module and one bound image; samples zeros for a key past the table;
does not fault for an invalid record under a clear EXEC; reports the
invalid record's address, words and reason when it selects it; and faults
when it stores over its selected record.

agc_shader_disk_cache: a selected column round-trips in the hand-built
plan, a fixture plans one and materializes it after a round trip, and a
selection past the sources is rejected.
2026-10-14 20:52:46 -07:00
Ondra97 c3b981c6a3 fix(tools): report comparisons blocked by base conflicts 2026-10-15 05:35:42 +02:00
hypermist a4639ad2fb Merge upstream main into perf/vector-window-unindexed-slots 2026-10-15 16:02:16 +13:00
hypermistandClaude Opus 5.5 16914b8fa5 docs(debt): describe the narrowed vector window and its measurement
The relative vector addressing entry still said every window register
lives in one function-scope array. It now describes the array of the
bounded slots, the per-slot variables, the OpSwitch fallback and
APS5_NO_WINDOW_NARROWING, with the RTX 3060 measurement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Uzy15wqYTt6iWyxYXEzUWo
2026-10-15 16:01:41 +13:00
milescovielloandClaude Opus 5.5 1d983101fe fix(agc): copy an indirect draw's vertex buffer only up to its last element
For an indirect draw, whose counts only the GPU knows, the driver copies
the whole range a vertex buffer descriptor covers, records * stride from
the descriptor's address. The last record's element ends sooner when the
attribute sits at an offset in its record, and the fetch can read at most
(records - 1) * stride plus the element.

Forspoken (PPSA03984) draws instances from a 48 MiB buffer of 96-byte
records with six attributes at offsets 0 to 0x50 in each record. The copy
for the attribute at 0x50 ran 0x50 bytes past the buffer into the
unmapped page after it, and the draw stopped with "guest memory is not
readable".

VertexBufferExtent now ends at the last record's element, as
VertexBufferReadSize does for the last record of a direct draw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 02:54:23 +00:00
milescovielloandClaude Opus 5.5 54f5c4187a perf(agc): free a registered shader's decoded program once it is planned
Since registered shaders are prepared in the background (#2583),
PlanRegistered keeps the decoded RDNA program in the
RegisteredPreparation it queues for the preparation pool. Only
PlanRegistered reads it, for the s_swappc_b64 check, so each queued
shader holds its decoded program until a pool worker has prepared it.
During the registration burst of Borderlands 4 (PPSA01494) these
programs held 638 MiB.

Decode into a local again, as before #2583.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 02:54:23 +00:00
ivica00 f2fd6e67d3 perf(agc): pipeline DMA_DATA by default and do not drain around it
DMA_DATA on queue 0 joins the draw pipeline unless APS5_NO_PIPELINE_DMA is set. A copy that does not overlap uncommitted draws, a SET_PREDICATION, and a NOP other than a dispatch reset leave the queue in place. The source bytes are snapshotted in packet order, an immediate fill still notes depth and color metadata, and a predication that reads an uncommitted range waits for it. Marker push and pop no longer allocate a string per packet.
2026-10-15 04:51:21 +02:00
Yunus Shaikh 67acc14910 Merge branch 'main' into feat/videoout-performance-overlay
main's StorageTextureBudget calls largestDeviceLocalHeap, the helper this branch made public as LargestDeviceLocalHeap for the overlay's VRAM line. The merge renames that call, so the merged tree builds.
2026-10-14 19:49:56 -07:00
Yunus Shaikh e147272368 feat(shader): name why image table narrowing is skipped
The [image-table] line under APS5_PROFILE_DRAW now splits the skipped
narrowings by reason: a value key that cannot be evaluated, a key
descriptor that is not a buffer, a key buffer with more positions than
APS5_IMAGE_TABLE_KEY_SCAN (with the most positions seen), pending GPU
writes over the key buffer, and an unmapped key page. Selected records
never narrow, so the line counts them apart.
2026-10-15 02:49:16 +00:00
bcba3b5b3e fix(agc): a pipelined release with INT_SEL 3 raises no interrupt
The pipelined label path treated every nonzero RELEASE_MEM INT_SEL as an end-of-pipe interrupt;
main's PacketMemory excludes 3 (send data after write confirm). agc_driver failed on it with
APS5_PIPELINED_DRAWS=1 ("release with INT_SEL send data after write confirm raised an interrupt").

Co-Authored-By: TheAggie <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-15 04:49:01 +02:00
411097197b fix(agc): a null storage image in a draw's written set writes nothing
DrawWriteRanges decoded every written storage image element, and DecodeTextureResource refuses a zero
base address, so a draw with a null storage image bound failed (PPSA01317) instead of skipping it.
The element is now skipped by the binder's own null rule (base address words zero) before it is
decoded. agc_driver_draw_write_ranges binds a null image next to a written one.

Co-Authored-By: Gjon Gojcevic <[email protected]>
Co-Authored-By: SleglJan <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-15 04:49:01 +02:00
28c123b386 perf(agc): pipeline queue-0 draw commits behind the packet worker (APS5_PIPELINED_DRAWS)
With APS5_PIPELINED_DRAWS=1, queue 0's worker decodes, captures and recompiles a draw and hands it to
a committer thread that records it (Graphics::Draw under the GPU lock), so the two run in parallel
instead of one after the other. Work the committer has not reached yet is tracked by the guest ranges
it will write; a later packet that reads or writes them, or one the pipeline cannot order, drains it.

Ordered as commit items instead of drains:
- labels (WRITE_DATA, RELEASE_MEM) and same-queue waits on them; APS5_PIPELINE_DRAIN_LABELS=1 drains;
- the end of a queue-0 submission and a released REWIND tail; APS5_PIPELINE_DRAIN_SUBMISSIONS=1 drains;
- the title's buffer fill kernels; APS5_PIPELINE_DRAIN_FILLS=1 drains;
- DMA_DATA immediates and copies (APS5_PIPELINE_DMA=1).
A draw's write ranges include the storage images it writes and its exact color and depth target
ranges (APS5_EXACT_DRAW_WRITES=1), not estimates.

Draw-path costs the pipeline exposed:
- ShaderMemory moves, so a commit owns its capture's pages;
- a submission made before the worker's current collect epoch began keeps the epoch, so a worker
  behind a queue of submissions walks a surface once per catch-up (APS5_SUBMISSION_EPOCH_EACH=1 bumps
  at every submission); a thread remembers the ranges it walked for the whole epoch;
- the pipeline signals only threads that wait; the pending-image and unit-shadow registries take a
  spinning slim lock instead of std::mutex (winpthreads contention was kernel events); ScanPending skips
  the registry walk when no pending image can overlap;
- fewer heap allocations per recorded draw (reused descriptor sets and scratch vectors, buffer pool
  size classes kept).

GTA V Performance mode, prologue bank interior, RTX 5080: 11.7 -> about 20 fps together with the cheaper
captures below it.
Off by default here; the follow-up turns it on.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Gjon Gojcevic <[email protected]>
2026-10-15 04:49:01 +02:00
Yunus Shaikh d4b33b0ae8 perf(shader): select the record of a T# whose offset the CPU evaluates
Since #757, a T# loaded from a buffer heap at a runtime offset is an
image table column, and every capture snapshots the whole heap, up to
65,536 records, even when user data or an SRT read fixes the offset.
When the T#'s eight dwords and its offset are runtime values the SRT
walker evaluates, the column is now selected: the offset is kept as a
descriptor source, the shader indexes entry 0, and the snapshot reads
only the record at the evaluated offset, with the heap base moved to
that record.

The column keeps a table's semantics. An invalid T#, an unmapped record
or an offset that carries past 32 bits is poison that faults only when a
lane selects it; an offset the walker cannot read faults the table
instead of throwing; the record's mode is picked per entry, so no
pipeline variant is added; and a dispatch that writes the record faults
it as written by its dispatch. Dwords past the heap read zeros, as the
scalar loads would, and a record past the key cap is read rather than
poisoned.

A column stays a whole table when its offset is chosen per lane, or when
the shader may write the memory the offset is read from at run time: the
buffer it is read from (by V#), or any memory when the read or a write
goes through a pointer or a GPU-only descriptor. Samplers are unchanged:
an S# the walker evaluates is already a direct sampler. The plan stores
the selection, so the disk cache format is 36.

Five agc_shader_memory and agc_shader_bindless checks asserted the old
planning and now assert the selected record:
- "image table SRT key": a key read through the SRT narrowed a 4-key
  table to records 0 and 2. It now selects record 2 alone, captures no
  other record, and a changed key moves the capture without changing the
  module or its disk key.
- "image table key union" and "image table late key": two keys of one
  heap shared one column with two value key domains. Each key now
  selects its own record, as two one-record tables.
- "image table unkeyed access": a read keyed through the SRT shared a
  whole column with a read keyed per lane. The first now selects its
  record; the second keeps the whole, unnarrowed table.
- "uniform table image": the T# at a user data offset was one key of a
  full table. It is now the one selected record, and the record the user
  data does not select is not read.
A value key domain only arises for a key the walker evaluates, so it no
longer narrows an image column; key buffer domains (keys loaded per
lane) still do.
2026-10-15 02:48:55 +00:00
valenciana-nc 0aa3b87448 fix(libSceAudioOut): check the audio buffer size for 32-bit overflow
prepareBuffer and queueAudio computed frames * channels * bytesPerSample
in 32-bit arithmetic. A large samplesNum from sceAudioOutOpen (which
only rejects len == 0) wraps the product, so buf.resize allocates a
truncated buffer while the mixing loops write frames * channels samples
past it. Compute the size in 64 bits and throw past INT32_MAX, which
also keeps the downstream int casts well-defined.
2026-10-15 02:36:05 +00:00
Dean a077a88df5 Merge pull request #5139 from Kikoarl/feat/ngs2-custom-module-user-fx
feat(ngs2): support custom submixer rack UserFx module 0x1d
2026-10-15 15:34:22 +13:00
Bruce Blake b6c9bd7f33 feat(libkernel): implement getdtablesize
Return the RLIMIT_NOFILE soft limit that getrlimit reports, capped at INT_MAX: FreeBSD sys_getdtablesize returns the smaller of that limit and maxfilesperproc, and the guest limit never exceeds the hard limit that bounds it here. The guest test now asserts the value instead of the throw, and the debt entry records the semantics.
2026-10-14 22:24:10 -04:00
Dean 760ffa6838 Merge pull request #6015 from oneandonlydean/carry/448-sample-masks
feat(agc): emulate PA_SC_AA_MASK sample masks
2026-10-15 15:07:41 +13:00
MarcZX100 0e7e149cce fix(shader): limit TYPE=0 null images to reads 2026-10-15 01:59:33 +00:00
MarcZX100 682b07eb03 fix(shader): track captured image descriptor words 2026-10-15 01:53:43 +00:00
Dean e858dbd78d Merge pull request #6193 from oneandonlydean/fix/ci-force-pr-refspec
ci(build): let a pull request's ref be replaced after it is force-pushed
2026-10-15 14:50:44 +13:00
m2 (AI Agent) 7f73643e0c test(relinker): name each program-layout check instead of tracking its line 2026-10-15 03:50:14 +02:00
SandstromPLandClaude Opus 5.5 4ef2af62ea fix(agc): rasterize a multisampled depth target without MSAA_ENABLE at the pixel center
A draw with PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES 2 (4x) and MSAA_ENABLE
clear into a 4x depth/stencil and color pair threw "multisampled
targets rasterized without MSAA_ENABLE are unsupported for points,
lines, a depth target or alpha-to-coverage", which stops METAL GEAR
SOLID: Peace Walker (PPSA18216) at its first presentation (draw B on
#5268). A depth target with the same sample count now gets the same
pixel center samples as the color targets, so each depth and stencil
sample is tested and written with the depth at the pixel center, as GL
allows when multisampling is disabled.

DB_EQAA Z interpolation or overrasterization and a sample-mask export
with a depth target throw on this path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 07:11:46 +05:30
DotDebian a61c70fc72 perf(agc): clear a register fast clear without waiting for a known key store
materializeRegisterClear clears the resident image to CB_COLOR_CLEAR_WORD
when the target's DCC keys read as the register clear code. Most of the
time those keys come from a key store the driver recorded itself
(NoteKeysFillOnGpu) and the GPU has not run it yet, so FillClear refused
with "keys pending" and the fallback waited for that store (SyncThrough).

The wait buys nothing when the newest recorded writer of the whole key
range is the noted store: ProvedCurrentDccKeys already answered from the
same memo (PendingStoreKeys), so the keys the GPU will hold are known and
are the code this clear stands for. The image clear and the
"uncompressed" key store after it are recorded into the same queue behind
that store and land after it, the order the wait gave.
KnownPendingDccKeys exposes that proof, and the register clear passes it
as FillClear's allowRegisterClear, which skips only the "keys pending"
refusal; the key scan still runs. Any other pending writer (a title
kernel, a later partial or wider write, a shadowed range) keeps the wait.

Tests: the proof answers only for a pending noted store covering the
range, and a clear recorded behind a pending register clear key store
leaves the clear word in memory and uncompressed keys.
2026-10-15 14:40:50 +13:00
MarcZX100 e76f79f5f4 test(shader): keep reserved image types invalid 2026-10-15 01:37:27 +00:00
Dean Galvin a0d71c8917 ci(build): let a pull request's ref be replaced after it is force-pushed 2026-10-15 14:37:21 +13:00
Yunus Shaikh 62bbbb5dcc refactor(agc): count an overlay draw packet after its pending waits land
Another open change adds a line at the start of the draw-packet branch in Driver::execute. The overlay's draw count now follows landPendingWaits instead, which counts the same packets.
2026-10-14 18:36:48 -07:00
Avijit SinghandCopilot 09afe38730 fix(web): identify invalid batch archives
Co-authored-by: Copilot <[email protected]>
2026-10-15 06:50:12 +05:30
Avijit SinghandCopilot 339c644b28 test(web): run batch helper checks in CI
Co-authored-by: Copilot <[email protected]>
2026-10-15 06:46:21 +05:30