Skip to content

feat(libSceNet): declare sceNetShowNetstat - #16

Closed
SleglJan wants to merge 14 commits into
mainfrom
feat/libscenet-show-netstat
Closed

SleglJan wants to merge 14 commits into
mainfrom
feat/libscenet-show-netstat

Conversation

@SleglJan

@SleglJan SleglJan commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

What

Declares sceNetShowNetstat in libSceNet. PPSA11386 (007 First Light) imports it; on main 8b393b6 it is one of the title's three missing imports, with sceSslGetCaList and sceSslFreeCaList (feat/libscessl-ca-list on this fork), so the host loader refuses the title until all three exist. The title does not call it during its start-up: with the three fork branches it runs to the shader in boykopovar#1921 without reaching it. The signature is unknown (shadPS4 declares it without parameters, as it does all its stubs), so it is declared without parameters and throws through NotImplemented_nid_no_patch; recorded in TechnicalDebt.

Overlap: boykopovar#2266 declares sceNetShowNetstatWithMemory and the other sceNetShow*WithMemory exports, not this one. The declaration sits after sceNetErrnoLoc; a trial merge against each open pull request that changes libSceNet/Export.cpp (boykopovar#1588, boykopovar#1786, boykopovar#2182, boykopovar#2185, boykopovar#2195, boykopovar#2266, boykopovar#2281) is clean in that file (at the end of the file it would conflict with boykopovar#2266).

Tested

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 in TechnicalDebt
  • 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: none
  • AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the intake paused Closed while PR intake is limited to authors with at least 20 PRs merged into main label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

oneandonlydean and others added 14 commits October 10, 2026 23:02
…raws

A draw whose stages bind a BDA table or a fault buffer builds resources
that need completion work, so noteReusable never keeps them and the shared
resource cache never holds an entry such a draw could hit. Building the
content key and probing the cache for each of them was pure cost. Those
draws now skip both (ShaderResources::NeverReusable) and count as
uncacheable.
Every small host buffer (size classes below 1 MiB: draw and dispatch data,
copied regions, snapshots) had a VkDeviceMemory of its own. When the pool
missed, the worker paid a vkAllocateMemory and vkMapMemory, and the release
thread a vkUnmapMemory and vkFreeMemory, for each one. The frees also stall
the worker's vkQueueSubmit in the driver.

A host-visible buffer of a size class now gets its own VkBuffer bound into a
slot of a shared block (2 MiB, or 8 slots for the large classes) per memory
type, size class and device-address use, mapped once. Releasing it destroys
only the VkBuffer and returns the slot; a block is freed when it empties and
its slab already keeps an empty one. A slot is used only when the buffer's
alignment and the non-coherent atom divide its size class, so the slot
offset is valid for the bind and Invalidate covers exactly the slot. The
pool still retains released buffers by class as before; only what backs
them changed.
DescriptorBinding gains bufferRead next to bufferWritten and bufferAtomic,
filled from the resource tracker's per-buffer read flag and kept in the
shader disk cache (format 24).
A written V# element bound in place in a host import makes every load a
PCIe round trip. A particle update that loads and stores a 10 MiB pool
(2048x64 threads over 131072 records of 80 bytes), above the 2 MiB written
window, took about 4.8 ms of GPU per frame.

An element the shader also reads (DescriptorBinding::bufferRead), written by
a direct dispatch whose threads times the V# stride cover at least half of
it, now takes device-local staging up to 16 MiB: that dispatch drops to
about 0.06 ms plus 0.9 ms of bulk copies. The coverage test keeps a kernel
that updates about 12k records of a 16 MiB pool in place, where staging all
of it would cost 1.3 ms of copies for a 0.08 ms kernel. Write-only
elements, indirect dispatches and raw (stride 0) buffers keep the 2 MiB
window.
perf(agc): sub-allocate small host buffers from shared memory blocks
…aw-key

perf(agc): skip the resource-cache key and lookup for address-based draws
…entries

A resource build decodes every image element's eight descriptor words,
describes the surface (a mip layout with a vector of levels) and finds the
sampled texture's cache entry by hashing its key, once in stage A and again
in stage B. Most elements repeat a small set of descriptors from build to
build.

Each worker now keeps a small direct-mapped memo by descriptor words of the
decoded resource, its guest size and view component mapping (pure functions
of the words) and of the cache entry the words last found. The entry is
reused only while the sampled texture cache has erased no entry since it
was found (an erase counter bumped by eraseTexture), so the list iterator is
still valid and still holds the same key; anything else takes the hash
lookup.
…he same texture

A build's sampled image elements often repeat the element just before them
in plan order (the same eight descriptor words). Each still took its own
stage-A record (decode, collect, DCC key read, cache entry) and its own
stage-B lookup.

The lookups run in plan order and nothing runs between two consecutive ones,
so a repeated element's lookup would find the state the previous lookup just
left: the entry it validated or made, current against the same collect. Such
an element now binds the previous element's texture (when the depth-compare
flag matches too, which is part of the cache key), and stage A gives it a
record of the decoded descriptor only. An element repeating an earlier but
not the immediately preceding one still takes its own lookup, as does any
element after a storage image lookup.
perf(agc): memoize decoded image descriptors and their texture cache entries
perf(agc): resolve a sampled element repeating the one before it to the same texture
…er-staging

perf(agc): stage read and written buffer elements a dispatch sweeps
PPSA11386 imports it; on main it is one of the title's three missing
imports, with sceSslGetCaList and sceSslFreeCaList, and the title does not
call it during its start-up. The signature is unknown, so it is declared
without parameters and throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SleglJan
SleglJan force-pushed the feat/libscenet-show-netstat branch from 625321d to 875ff3f Compare October 10, 2026 16:15
@SleglJan

Copy link
Copy Markdown
Owner Author

Merged upstream as boykopovar#2831.

@SleglJan SleglJan closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants