Exercise source-rate conversion through the real worker and AAC calibration across AVC, HEVC/PQ and AV1 receiver cases, including TLS. Check normalized duration independently and compare every submitted PCM sample before packet replay.
Keep producer timestamps and queue capacity in source frames, configure AAC at a native rate and initialize conversion before exposing the Surface. Preserve direct standard-rate input. Cancel partial network startup on setup failure, retaining the original error.
Full Windows C89 and GCC/Clang sanitizer suites pass, including source clocks and conversion-startup rollback. Native device acceptance remains separate.
Borrow queue spans, convert at most 256 source frames per action and retain output across partial encoder acceptance. Track source and encoded ends separately through calibration, trim and cancellation. Calculate ceil durations exactly from the binary64 source rate.
Tests cover fractional mono/stereo, packet boundaries, anti-aliasing, empty/short EOF, source gaps, cancellation and file/live calibration. An independent Python rational oracle checks 176 duration cases.
Correct sub-phase rounding after bounded offline chunks without changing normal playback processing. Check the actual correction kernel against a nine-hour exact sample-clock oracle.
Center offline output on source frame zero and report the input lookahead needed for tail draining. Existing processing and reset paths remain unchanged. This supplies latency handling for worker-owned fractional recording conversion.
Check impulses, independent fractional-rate tone phase, chunk invariance and tail drain at 8-192 kHz. GCC/Clang sanitizers, Windows C89 and four NDK ABI builds pass; missing and one-frame compensation mutants are rejected.
Accept vcodec=av1, route its sized OBUs to enhanced FLV, and preserve SDR/HDR profile and source color admission. Select Android AV1 levels from Annex A main-tier display-rate, picture, dimension, header-rate and bitrate bounds; native inventory still validates the complete request.
Strict C89 Windows and Linux ASan/UBSan frontend/session/worker suites pass. File and stream tests cover SDR, PQ and scRGB; four actual-source MIME, routing and level-limit mutations are rejected. Native device encoder acceptance remains separate.
Some CI libaom builds leave primaries and transfer unspecified despite encoder options. Apply the independent FFmpeg AV1 metadata filter and verify the source CICP before transmission, keeping the production mux agreement checks strict.
Add enhanced RTMP receiver cases for HEVC 8-bit, HEVC 10-bit PQ and AV1. Verify decoded pictures, complete source PCM, source epochs and color metadata over standard/legacy RTMP, TLS 1.2/1.3 and video-only output. Preserve ten-bit samples in the comparison and retain AVC coverage.
Replay independently encoded AVC/AAC only at the encoder boundary while running the actual worker, PCM queue, AAC probe, FLV adapter and RTMP/TLS client. Check partial PCM acceptance, silent preroll, calibration removal, source PCM recovery, video epoch and EOS drain. Keep adapter-only checks and run both targets in CI.
Validation: GCC and Clang ASan/UBSan five-case receiver runs pass (standard/legacy RTMP, TLS 1.2/1.3, video-only). A two-millisecond actual worker video epoch mutation is rejected after successful transport. This is portable integration evidence, not native MediaCodec device acceptance.
Reuse decoder-owned slot buffers for analysis and synthesis. This keeps the strict GCC ASan/UBSan C89 build below the 2 KiB frame limit without allocating during decoding. Mark two parser context parameters intentionally unused.
Validation: AAC size, layout, reset/savestate and parametric stereo tests pass with ASan/UBSan; calibrated AVC/AAC worker reception passes independent source PCM comparisons.
Require fresh explicit artifact directories so reruns cannot overwrite failures. Verify received codec, sample rate and channel identity as well as packet clocks and decoded bytes. The strengthened five-case oracle passes with the previously built GCC sanitizer publisher.
Replay independently encoded AVC/AAC through the real native output adapter, shared FLV mux, owned RTMP client and TCP/TLS transport. Compare received packet counts, millisecond timestamps and independently decoded RGB/PCM bytes. Cover standard and legacy RTMP, TLS 1.2/1.3 and video-only output.
GCC and Clang ASan/UBSan matrices pass five cases each (120 pictures and 80 AAC packets per compiler). An adapter mutation shifting both media clocks by one second is rejected after successful transport drain. Metadata getters and encoded packet input are replayed: native MediaCodec, the calibrated worker and device capture are not established by this test. Add the matrix to Android CI and retain exact evidence.
Select the owned stream dispatcher for RTMP(S), validate native FLV/AAC options, propagate coded HDR source metadata, and keep stream URLs out of file history. Expose backend streaming capability and enable shared RTMP/FLV in Vulkan Android NDK builds with crypto.
Windows frontend and native menu checks pass; full arm64 Android library builds and links with native streaming entry points and passes 16 KiB ELF alignment. This is build/contract acceptance, not physical-device or independent receiver acceptance. Direct integer source audio rates and AVC/HEVC are retained; fractional-rate resampling and AV1 frontend selection remain separate work.
Copy native stream configuration and URL at cold startup. Negotiate the owned shared RTMP client before publishing Surface readiness, poll producer/resolver/socket interests together, and keep detached DNS notifications independent of dispatcher lifetime. Setup and drain deadlines are I/O-owner-only; no new frame/audio waits or clocks.
Windows contract suite, focused Linux ASan/UBSan and TSan thread/wake tests, and eight actual Android NDK dispatcher compiles pass. Client and recording session boundaries remain mocked; real receiver/device acceptance and frontend activation remain pending.
Fault injection exposed a fixture gap: a file audio-edit query on a network session did not fail. Track network output lifetime so trim queries and codec stop are rejected until the appropriate file mode or output retirement. Four actual-session mutations now fail; restored Linux sanitizer and Windows strict-C89 fixtures pass.
Add an RTMP/FLV-gated network session constructor and bounded network service entry point. Select live AAC priming, skip file creation and MP4 edits, report socket interests, and retire the output before stopping codecs or releasing encoders. The caller retains client ownership.
Windows strict C89 suite plus focused completion check pass. Session fixtures cover cold rollback, file regressions, network failure, delayed retirement and source/GPU closure with native/output boundaries mocked. Dispatcher activation and real receiver/device acceptance remain pending.
Gate source PCM until measured delay determines the silent input boundary. Drop complete calibration packets before output, retain silent AAC preroll and shift video/source ends to the same epoch. Preserve the existing MP4 calibration/edit path and stable descriptors across output backpressure.
Strict C89 Windows suite passes; calibrated fixtures cover six delays, empty PCM, output backpressure and early cancellation. Native MediaCodec and network session activation still require acceptance.
Calculate packet-aligned source input and coded origins from measured encoder delay, retaining two silent AAC frames before source audio and rounding the matching video epoch upward. Keep file edit semantics separate.
Check all delays 0-4096 at six rates. Independently encode/decode synthetic AAC-LC at 44.1/48 kHz mono/stereo, recover delay from the chirp, omit calibration packets and compare source PCM against continuous decoding. This is not MediaCodec device acceptance or dispatcher activation.
Add a bounded I/O-worker output adapter with cold mux setup, serialized packet admission, transport backpressure, normal drain and cancellation retirement. Keep the MediaCodec descriptor live until both shared mux and RTMP transport borrows retire.
The controller must establish live AAC priming and source epochs separately; this adapter does not enable Android streaming or reuse MP4 calibration edits. Strict C89 Windows contract suite passes with the actual shared FLV mux and mocked transport.
Create worker-side AVC/HEVC/AV1 mux configuration from bounded native CSD and optional AAC setup. Join separate AVC parameter sets only during cold setup, retain neither native format nor encoder metadata, and preserve microsecond packet clocks without rebasing. Reuse shared Annex B and AV1 mux validation, including codec-specific packet budgets and depth/color admission.
Add actual shared-mux fixtures for configuration copying, separate/combined AVC setup, AAC payload borrowing, microsecond timestamps, codec depth mismatch and early packet-budget refusal. This does not enable the unfinished Android network publisher.
Add a copied worker-owned output callback table, with the existing file mux as the default adapter. Retain one immutable native packet descriptor per encoder while output is BUSY; calibrate AAC only once for that packet and release the codec borrow only after output acceptance. Worker free waits for bounded output retirement before encoder destruction is allowed.
Exercise no-repump/no-early-release behavior, callback-table ownership, delayed cancellation retirement and calibrated coded/source clocks under BUSY. The strict-C89 native MinGW MediaCodec suite passes. Android network publisher integration remains unfinished.
Allow the owning worker to inspect native csd-0/csd-1 buffers before constructing shared stream output. Bound each buffer to 65535 bytes, clear outputs on refusal and preserve encoder state for optional/malformed metadata. No dequeue, release, allocation or encoded-payload copy occurs. Audio and stopped encoders cannot expose video configuration.
Cover separate CSD borrows, missing/malformed/oversized metadata, invalid arguments, audio refusal and stopped-state invalidation. Streaming remains disabled pending output/publisher and lifecycle integration.
The unsized uniform-buffer fixture uses a Vulkan extension added after the
system standalone validator. Running it through the old Vulkan 1.0 profile
rejects a legal Uniform/Block runtime array. Its std430 layout also needs the
standard uniform-buffer layout feature enabled during independent validation.
Use a pinned current SPIRV-Tools validator and matching headers in a dedicated
cached CI job. Keep Vulkan 1.0 for ordinary fixtures and Vulkan 1.1 for subgroup
operations; apply the extension fixture's required rules only to that module.
Do not skip incompatible-validator failures or relax other shaders' checks.
Deliberately misalign a member of the emitted UBO and require its rejection.
Validation: all 40 emitted SPIR-V modules pass current standalone validation;
the corrupted UBO fails alignment validation. Extended compiler and builder
contracts pass ASan/UBSan, and all five emitted GLSL programs pass glslang.
The pinned setup helper passes cold-source and cached-build runs. No production
shader compiler or device-feature admission is changed.
Connect the admitted desktop Vulkan encode queue to viewport recording through
an asynchronous worker. Capture GPU pixels in the renderer submission, publish
only successful submissions, and retain source/device resources through stop,
resize and deferred video reinitialization. Refuse unsupported devices, HDR,
formats and audio layouts before creating output. Start after the first core
frame so admission uses its actual audio layout.
Hold PCM on the existing worker queue until encoded video establishes its
clock limit. Trim trailing queued PCM at video EOS before AC-3 padding and
publish the actual consumed count after worker retirement. This prevents a
threaded resize from leaving audio beyond the last captured picture. Add no
producer locks, waits, pixel readbacks or pacing logs.
Configure selects the driver on desktop Vulkan builds with its dependencies;
existing default driver priority is retained. Add frontend admission/lifetime,
delayed-video PCM, terminal-result publication and native isolated-window
resize/reinit/stop regression coverage.
Validation: GCC/Clang ASan+UBSan frontend contracts, Vulkan encode contracts,
recording output/session/dispatch contracts and independent MP4 A/V checks.
Windows native recording passes threaded/direct multichannel float PCM at
32/44.1/48 kHz, plus resize, reinit and stop with Khronos sync validation.
Desktop Linux and Windows frontends build with automatic feature selection.
Native Linux GPU acceptance remains open. The unrelated extended RSLC unsized
uniform-buffer fixture is rejected by the installed standalone SPIR-V validator;
that check is retained as a failure, not reported as an extended-suite pass.
Merge capture timeline dependencies without modifying caller batches, then publish slots only after native submission succeeds. Retain producer ownership through uncertain results, command discard and timeline retirement; preserve the pool borrow if admission disappears during a frame.
Strict C89 and Windows/GCC/Clang sanitizer fixtures cover semaphore chains, bounded admission and failure recovery. Native direct-image and buffer A/V checks exercise binary semaphores, an existing timeline and a reset/discard value gap with zero synchronization-validation errors. Frontend driver binding remains separate.
Compile and publish optional capture resources with dispatcher readiness, then retire them on the worker after the video producer proves its GPU commands complete. Keep the encoder pool alive through capture destruction and skip unused capture startup after early cancellation.
Lifecycle regressions cover startup refusal, cancellation and independent video/audio closure; an injected premature destruction fails. Native direct-image and buffer A/V runs pass with zero synchronization-validation errors, alongside Windows, GCC/Clang sanitizers, TSan and a linked threadless frontend. Renderer binding remains separate.
Own session startup, file output and retirement on a dedicated worker. Publish immutable pool borrows after startup, wake through the existing lock-free eventcount backend and wait for each producer to close itself before teardown. Add concurrent startup/cancel/error contracts and native GPU A/V acceptance for both capture paths. Threadless and locking-fallback configurations refuse admission.
Cover cached output, failed mux binding, converter setup failure and retryable reset retirement through the shipping adapter helpers for one through eight channels. Keep native API mocks distinct from macOS runtime acceptance.
Keep the producer clock and queue budget in source frames. Convert on the recording worker through AudioToolbox, retain converted packets across mux backpressure and retire native input borrows before queue teardown. Preserve the direct path for integral rates and extend conversion contracts through eight channels.
Submit two GPU-captured pictures before collecting either packet. Check full-ring backpressure, stable borrowed bytes during cancellation, refusal of premature free and successful drain after GPU retirement. Keep the twelve-picture independent decode and synchronization-validation gates for both storage paths.
Exercise the shipping RSLC-compiled RGB-to-NV12 conversion on a compute queue and hand its direct-plane or packed-buffer output to the encode queue through GPU timelines. Independently verify decoded color planes, GOP and timing with synchronization validation enabled. Keep native fixture scratch within the C89 2 KiB stack gate.
Submit twelve test-uploaded NV12 pictures through real GPU timelines and encoder packet leases. Independently check planes, GOP, color and SPS timing, retaining failed oracle evidence. Keep GPU capture and frontend activation as separate acceptance gates.
Require a real encode queue and Khronos validation layer. Probe supported extents and build 2/4/16-slot pools, including direct storage and buffer fallback, retrieve driver headers and retire empty sessions. Preserve native evidence and report unavailable hardware separately; no picture or pixel acceptance is claimed.
The X display server gains the vblank clock the setting's hold waits
on. It asks the Present extension for a notification at the vblank
count after the last one seen; the answer carries that vblank's count
and its time on the monotonic clock, for the CRTC the window is on.
The requests are made with xcb's own request call, so nothing beyond
libxcb is linked, on a connection of the clock's own: a wait is a
bounded poll of its socket, there is no thread, and no other thread's
events are read. A window destroyed, a server without Present or one
whose stamps are of another clock leave no clock, and the timer paces.
The GLX context says its swap tears with no swap interval where no
compositor shows the window: it asked to bypass one, or none runs.
samples/gfx/x11_vblank runs the clock against a real server in CI.
A fast machine wrote the whole state before the close came, leaving it
nothing to wait for. The lane now takes a background save on the
threaded queue, which the harness core holds inside retro_serialize
until the close has waited three frames, so the save is in flight
however fast the machine is.
core_signature_test declared its statfs loop index where macOS's clang
found it unused. d3d_failure_paths compiles d3d11.c's resize, which now
clears D3D11_ST_FLAG_FLIPS_ASKED, so the harness declares it.
glibc names the word f_flags from 2.13; 2.12 (the webOS SDK's) has it
as f_spare[0], where the kernel puts it, and old uClibc does not name
it at all. The read-only flag comes from that word where there is one
and from statvfs otherwise.
A save over an existing file is two tasks: a load of that file for the
undo, whose callback pushes the save. With threaded tasks the queue
stops refusing a blocking task once the one in flight has finished on
its thread, so a Load State pressed after the backup load was done and
before its callback had run was pushed there and then, and read the
file the save was about to replace. The state tasks' own counts say
whether one is in flight - pushed, its callback still to come - and a
request is held behind it until then, as it is behind one still
running.
The state-load-latency lane of content_load_test takes that case, and
bounds a load by a display's frames where the machine is too busy for
the harness's own, microseconds long, to mean anything.
The still menu was shot once three grabs in a row matched. A RetroArch
slow to come up leaves the screen black for those three, so the shot
was taken before the menu was drawn. Black grabs no longer count
towards settling: the shot waits for the menu, and a menu that never
draws is still judged black at the deadline.
The filesystem lists, the /proc mount lookup, the statvfs read-only
tests and the Windows drive-letter test move out of the check onto
retro_vfs_file_volume_impl() and retro_vfs_stat_volume_impl().
On the way, a quick check of a core with no record asks less:
- The open's one fstatfs() now gives both ctime_kept and whether the
mount is read-only; before, the exemption and package rules each
asked statvfs again.
- The identity the open took carries the owner, group and mode (never
stored), so the exemption rule no longer fstat()s the file again;
the macOS package re-check uses it too.
- RetroArch's own mount id is looked up once with the rest of its
self lookup, instead of opening /proc/self/exe and asking its mount
on every check.
Linux, unrecorded core, open + quick check: 21 -> 14 syscalls, about
5.9 -> 3.8 us. Every answer is unchanged: the rules read the same
uid, gid, mode, read-only and mount facts as before.
core_fd_mount(), core_fdinfo_mount() and core_fs_*_keeps_ctime() are
gone; core_file_unwritable() and core_file_in_package() take the
identity and RetroArch's own lookup.
retro_vfs_file_volume_impl() tells, for an open stream, what its
volume is; retro_vfs_stat_volume_impl() the same for a path, following
links. The caller says what it wants, as each part costs a query of its
own on some platforms:
- WANT_FLAGS: mounted read-only, and whether the filesystem's kernel
alone sets change times (so no user can forge one). One fstatfs()
answers both on Linux (statfs's f_flags, ST_VALID since 2.6.36, with
a statvfs fallback before that), macOS and the BSDs; statvfs()
elsewhere on POSIX. Windows reads FILE_READ_ONLY_VOLUME through
GetVolumeInformationByHandleW, looked up by name once, lock-free.
- WANT_MOUNT (Linux): the mount id, from statx's STATX_MNT_ID through
syscall(), else /proc/self/fdinfo.
- WANT_KIND (Windows): the drive type of the path's drive letter -
fixed, removable, remote or RAM.
Purely additive: nothing existing calls it. UWP answers "can't be
told"; the backend parity check agrees on all 44 symbols.
vfs_stable_test checks it against statfs/statvfs and /proc's mnt_id,
two opens of a file against each other and the path lookup, /proc as
another mount, and Windows' drive kind and flags (under wine, 64-bit,
64-bit stdio and 32-bit). The fdinfo fallback was run with statx
refused.
The store's file-kind test, the store folder's device, RetroArch's own
file lookup, the folder-ownership walk and the macOS "is the real path
this same file" re-check now use retro_vfs_file_identity_impl() and
retro_vfs_stat_identity_impl() instead of stat()/fstat() and
GetFileAttributesW. The ownership rules get the same uid, gid and mode
they read before, so every answer is unchanged, and POSIX makes the
same syscalls as before.
struct retro_vfs_file_identity now also carries the owner, group and
POSIX permission bits (where the platform has them, flagged by
RETRO_VFS_IDENTITY_HAS_OWNER) and whether it is a regular file, a
folder or something else.
retro_vfs_stat_identity_impl() gives the same identity for what a path
names, following links, without opening a stream: stat() on POSIX; on
Windows a handle opened only to query attributes, shared with everyone,
so a folder or a file another process holds open answers too. It tells
"nothing there" (1/0) apart from "can't be told" (-1), so callers can
keep a missing file distinct from one they may not look at.
Purely additive: the new fields are filled from the stat/handle query
the identity already made, so no stream gains a syscall. UWP gets a
definition that answers "can't be told"; the backend parity check
agrees on all 42 symbols. vfs_stable_test covers the fields against
stat(), folders, missing paths, links, FIFOs/devices and an
unsearchable folder (as a non-root user).
retro_vfs_file_write_at_impl() (filestream_write_at()) wrote without
touching the stream's size at all: after a positional write past the
end, or an append, retro_vfs_file_size_impl(), filestream_get_size()
and filestream_eof() still gave the size from before it. On master a
new test finds it on descriptor and stdio streams alike - grown files
reported at their old size, appends at 0, eof true in the middle of
the file.
A positional write that writes now marks the stream's size_grown, an
atomic of its own beside append_end (positional writers run on any
number of threads at once, so the hint bits that a descriptor write
marks are no place for it). It reads the mark first and sets it only
if unset, so writers on many threads don't all store to one line. The
next size query clears the mark and then asks the file, so a write
landing after the clear marks it again and none is missed: a
descriptor's size is the file's; a stdio or native Windows stream's,
which may still hold bytes of its own, the larger of the file's and
what its own writes reached. No lock, no wait.
Built where the size can be asked of the file (VFS_SIZE_LAZY, as for
the descriptor writes); where there is no positional I/O nothing
changes.
samples/file/vfs/vfs_positional_size_test: writes past the end, inside,
after a truncate, appends, and four threads writing interleaved records
at once, on descriptor and stdio streams, through the impl and through
filestream (get_size, tell, eof); it fails on master and passes now -
on Linux with and without mmap, under ASan/UBSan and ThreadSanitizer,
and as 64-bit native and C-runtime and 32-bit Windows builds under
wine - and is added to both samples workflows. vfs_size_contract_test
and the rest of the VFS suite pass as before (under wine, the same
three tests master fails there).
Cost: four threads of 64-byte positional writes on one stream, best of
five passes, four runs - 749/437/555/631 ns per write before,
623/415/672/598 ns after: within the run-to-run noise.
Display Pacing On VBlank Events holds a frame for a vblank only where
the present would otherwise tear. A Vulkan swapchain of its own in
immediate mode said so on any output, although DWM still composes a
fullscreen window where the output cannot flip it itself, and the hold
then costs latency for nothing. The driver asks the output its window
is on, once a swapchain, as the D3D drivers and the DXGI presenter do.
The DXGI bridge gains the query by window: it makes a factory, finds
the output showing the window's monitor on any adapter, and asks
CheckHardwareCompositionSupport. Covered by samples/gfx/dxgi_present
(window) and samples/gfx/dxgi_present_immediate (vulkan).
Every write on the descriptor path (a SEQUENTIAL_BULK stream opened to
write, to read and write, or to update a file in place) asked the file
position first - one lseek() per write call - for one thing only: to
keep stream->size, which retro_vfs_file_size_impl() hands back, up to
date. writev did the same once per call. Most write streams never ask
their size.
Now a descriptor write marks the size stale instead, and the next size
query asks the file once: one fstat() (_fstati64() on Windows), or a
seek to the end and back should that fail. A truncate sets the size
and clears the mark; the on-demand mapping asks the size the same way.
Nothing keeps a position of its own, so code seeking the descriptor
directly can't put anything out of step, and the size reported is the
file's own.
Where neither fstat nor _fstati64 answers for a descriptor (the
consoles), writes keep asking the position as before. stdio, native
Windows, NFS and SMB streams, and the positional and append writes, are
untouched.
samples/file/vfs/vfs_size_contract_test pins what a stream says its
size is - after appends, a write inside the file, one across its end,
a seek past the end and the write after it, an empty write, a writev
with an empty piece, a truncate and a write at the new end, and reads -
on the descriptor path for writing, reading and writing, and updating
in place, and on stdio, with retro_vfs_file_size_impl(), the size on
disk, and filestream_get_size()/filestream_eof()/filestream_tell(). It
was written against the code before this change and passed there
(Linux; 64-bit native and C-runtime and 32-bit Windows builds under
wine), and passes after it the same way, and under ASan and UBSan;
it is added to both samples workflows. The rest of the VFS suite passes
on Linux with and without mmap; under wine it fails the same three
tests master fails there (vfs_rename_replace_test,
filestream_rbuf_fault_test with C-runtime streams,
vfs_seek_contract_test's 4 GiB case in 32-bit).
Measured on Linux, 20000 writes to one SEQUENTIAL_BULK stream, best of
six passes, three runs: 64-byte writes 386/356/319 ns before, 271/255/
260 ns after; 4096-byte writes 1830/1616/1731 ns before, 1616/1574/
1637 ns after. Counted with strace over 7000 writes and a size query
per pass: 7000 lseek() before, none after, and fstat() once per query.
vfs_native_bench is unchanged within its noise (its write rows use
stdio streams).
With a threaded hardware core, the frame is drawn from whichever of
the ring's three slots the core rendered into. The GLSL chain set
clamp-to-edge and the filter on the HW-render texture current when
it was made (slot 0) only; slots 1 and 2 kept GL's defaults, repeat
and a linear filter, so their frames bled the texture's far edge into
the border: a one-pixel frame at two thirds brightness.
gl_shared_context_test failed on that (GLX and EGL, threaded, 3.3
core: 668 of 27648 pixels). A build without slang now takes glcore's
GLSL path for a core profile, which brought it out. All eight cases
pass now.