From @ismailchaka1's check on #3341: types 4-8 have a {ptr, count} array at
+0x20 (null on type 4 and on 431 of 482 type-5 nodes; on every type-6/8 node,
items {u32, 0, u32, 0}). Counted as motion_node_pairs:<type>:<count|null> and
documented; the values are not decoded. Rechecked on anim.rpf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured over the 434 ShoreWavePlacementData patches and 7,839 control
points of my own 1.0.2.1 package (aggregate numbers only):
- lateralCoord is linear in arc length along the polyline, at one rate
everywhere: |b| median 0.00200 per world unit, 1.0 every ~500 units,
the same for every waveType. It decreases strictly along 416 of the
434 patches (b < 0 on 426); only 197 of 7,405 steps reverse, by a
median 0.018. The earlier "not monotonic along 433 of 434" counted
increasing values only.
- waveType doesn't change amplitude (1.0 everywhere) or that rate. Type 3
has the shortest reach (maxDistance median 64.6, the only values below
17), and the six type 2 patches lie in one area. What the types select
stays open.
The first version called +0x18 bit 13 road surface. The count cannot
tell it from bit 8: both lie under about nine in ten lane nodes. The
tool now also counts the four combinations of the two bits (both, only
one, neither) for nodes and area: 89.6% of the nodes stand on polygons
with both bits, which cover 2.5% of the area, and bit 13 alone covers
9.5% with 0.6% of the nodes. The doc reports that, keeps SixNG's label
as its visual reading, and leaves which bit means road surface open.
docs/related_projects.md gets a SixNG entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rdna2spirv: declare each packed vertex input register once; a register whose elements disagree on the component
type is refused (SHADER-644).
- runtime: a title's VirtualAlloc drops the console's MEM_GRAPHICS / MEM_TITLE type bits the host rejects (RT-217).
- runtime: XPersistentLocalStorageImpl is served from <overlay>\persistent with the package's 2048 MB quota
(RT-219; layout from the public docs, not measured in a caller).
- runtime: G:\ names the package and T:\ a scratch folder in the overlay; paths under the configured folders and
every path with no folders configured stay host paths (RT-218).
- winhttp_offline: header blocks and timeouts the host WinHTTP rejects are rejected the same way.
- cfg_structure.run: a limit of zero or less runs no blocks.
- shader_meta: an s_movk_i32 with a register operand and a float immediate beyond float32 are left unknown instead
of raising.
Each comes with a test that fails on the old code. Conflicts with main resolved here (internal_dir() hides T:'s
folder; both file_system_test blocks kept).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds --pick and --check --full-check, the updated game-folder search, the low-disk run-only build, the current --wave64-emulate behaviour, the fallback flags, --wav and the Linux/Wine notes, and the claim-before-PR rule. Moves the Polish row's synced commit in docs/i18n/README.md.
Review on #3655 (kacper-serewis, daemosofchaos, on Windows 11):
- A parameter block shorter than COPYFILE2_EXTENDED_PARAMETERS (dwSize
0, 4, 31) made the fallback copy and return S_OK, where the host's
CopyFile2 returns E_INVALIDARG and writes nothing. Both paths now
check it first, before copy_paths prepares the destination.
- The fallback silently dropped COPY_FILE_SKIP_ALTERNATE_STREAMS and
copied the stream. Its flags are now sorted: passed on (the ones both
calls define), dropped (requests that leave the contents as
CopyFileExW writes them: no offload, compressed traffic, sparse copy,
...), or refused with ERROR_NOT_SUPPORTED before anything is written
(SKIP_ALTERNATE_STREAMS, DIRECTORY, OPEN_AND_COPY_REPARSE_POINT,
IGNORE_SOURCE_ENCRYPTION, unknown bits, a longer V2 block).
- A cancel flag already set is answered by the fallback itself, since
Wine 9's CopyFileExW doesn't read it.
rt::fs::force_copy_file2_fallback lets the test run the fallback on
Windows, where the host has CopyFile2 (Maraco91 noted it couldn't be
reached there). file_system_test runs its CopyFile2 checks both ways:
no block, short blocks, fail-if-exists with a hint flag, a set cancel
flag, and in the fallback the refused flags and block.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GN11jcpJWD4phrXJyDgED6
With placed buffers aliasing in one heap, a large buffer B and a small S
inside it, a vertex or index view that starts in S and runs past its end
resolved to S, the closest start below the VA, and buffer_at cut it at
S's end: the rest read as out of bounds, though B holds all of it. Found
by traeb0n in the review of #2823.
BufferVaIndex::find takes the bytes the lookup needs and returns, among
the ranges that hold the VA, the closest start (larger ID on a tie) that
also holds all of them; when none does, the closest that holds the VA,
as before. Without overlaps the first range it looks at is still the
answer. With a fallback found, the walk stops once no range can hold all
the bytes, bounded by the longest live range. buffer_at passes the
requested size.
buffer_va_index_test checks views that fit in the small buffer, run past
it into the large one, run past every range and have size 0, and three
quarters of the random-table lookups now name a view of up to 32 KiB,
checked against a scan with the same rule.
Measured over the 504 ratingsRoad/ratingsOffroad blocks of common.rpf's CVehicleBaseRatingsAndEstimatesMap
(252 keys x 2 surfaces) from one retail 1.0.2.1 package: fOverallRating = 0.21 fSpeedRating + 0.38
fHandlingRating + 0.40 fAccelerationRating + 0.01 fBrakesRating, weights summing to 1. The residual is at most
7e-5 on the 345 blocks whose four parts are all above 10, and differencing the road and offroad blocks of the
139 keys that are above 10 on both surfaces recovers 0.2100 / 0.3800 / 0.4000 / 0.0100, so the weights do not
depend on the surface.
The 10 floor is on the overall too: 24 blocks whose parts run 10.0 to 11.97 carry an fOverallRating of exactly
10. The other 159 blocks, which have at least one part at exactly 10, sit up to 4.1 below the weighted mean,
which parts raised to 10 from a lower value would explain; no block without a part at 10 deviates.
Counts, ranges and coefficients only: no model names and no per-vehicle values, and no game file is committed.
Four findings by @HQasper on tools/rbf0_encode.py:
- `--check` exited 0 when resources were refused, so a round trip that verified nothing read as success.
It now exits 0 only when every resource is byte-identical, as rbf0_tree.py does for a resource that is
not ok.
- The element header count came from `attrs_declared` while every node of `attributes` was written, so an
attribute appended by hand encoded as the element's first content value: a different tree with status
ok. encode() now refuses more attribute records than the count (value), and an element short of its
count that has a value in its content, which would decode as an attribute (order). A parsed element
short of its count with no such value still round-trips exactly.
- `blob[:doc["size"]]` in resources() could not trim anything. The slice is gone and check() compares
the joined length with the recorded size; two carved streams of one name are refused instead of the
last one silently winning.
- docs/rbf0.md 9.6 lists the `value` refusals and says what `--check` exits with.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two occupied slots with the same key and distinct payload indices passed
values_bijective, then folded into one dict entry in _grid_slots, so the
octree check passed and the depth and leaf counts lost an entry
(reported by Oblyterium on #3622). Require len(keys) == entries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add tools/world_interior_names.py: reads CMloArchetypeDef, CMloRoomDef and
CMloInstanceDef from levels.rpf and joins them with the InteriorNames section
of GameShape__Data__LocationNameLoopkup. 1,357 of 1,358 keys are interior
archetype names, all confirmed by the 64-bit key; docs/world.md records the
placement and position measurements.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The layer reports UnrestrictedBufferTextureCopyPitchSupported as FALSE and
refuses a footprint whose Offset or RowPitch is not 512/256-aligned, the
pair D3D12 specifies. The PC runtime (RTX 4090, WARP) reports the capability
and accepts such a list. Say that the difference is deliberate, why (Vulkan
takes offsets and row lengths in texels), and what lifting it would take.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
d3d12_compute and the other tests that write a translator-style shader library under
the temp directory (d3d12_draw, d3d12_set0_compute, d3d12_msaa_draw, d3d12_fspx_compute,
d3d12_pipeline_library, d3d12_subgroup, d3d12_bundle, d3d12_typeless_families,
shader_library) used one fixed folder name. Two copies running at once (ctest -j, or two
suites in one Wine prefix or TMPDIR) shared it, and one copy's remove_all deleted the
modules the other was loading: on an Apple M3 Max under Wine with MoltenVK 1.4.3, four
copies of d3d12_compute at once failed 6 of 40 runs (PSO creation at lines 245/357, or
exit 3 from an uncaught filesystem_error in copy_file), while 125 runs one at a time all
passed.
test_temp_dir.h names the folder <temp>/<name>_<pid>, removes it on scope exit (early
returns included), and copies the compiled-in LEONIDA_TEST_*_SPV files with an error
code, so a missing file is reported by name instead of ending the test with abort().
docs/testing.md lists both symptoms.
All 7,577 mesh streams parse (6 stop at non-mesh data after the chunks);
positions, faces, normals, tangents, radius and cones hold as in the minigame
archive (counts only); the stored centres match the box centre less often.
e = 0..4 occur; the bit-28-only rule read the 157 minigame meshlets with e = 2
at 1/8 m, where their radius covers none of them (157 of 157 at 1/4 m).
centre_step takes the exponent, coarse_steps counts e > 0, tests cover e = 1..3,
and the docs/story.md tables are recounted.
When several 42 40 blocks in a page have a group's vertex count, summarise_page took the nearest one before the
group. Nothing in the page orders them (in Q0 Q1 G0 G1 pages G0 is built on either block), so it now takes the
block whose vertex boxes are closest to the group's stored centres (centre_distance), keeping the old choice on
a tie. New counters groups_4240_several_blocks and groups_4240_block_by_centres.
Over all of story000.rpf: 16,059 groups have several blocks and 8,668 change block; opposed neighbouring faces
fall from 518,113 to 16,408 of about 36.7 M shared edges, and faces within ~25 degrees rise from 90.8% to 92.7%.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game's RT shaders build the BVH descriptor base as (ptr & ~0xFF) | 0x30: a
byte address with flags in the low bits, not the 256-byte-unit field the
emulation assumed (base40 << 8). Masking the low byte fixes the address; a
non-zero base moved every node by 256x the flags.
The semantic test now runs the masked-base case (dword0 0x1030 -> base 0x1000,
node at 0x1040) and fails under the old shift. Measured with the first real
core_bvh4 BLAS (docs/bvh.md 7b): header at VA 0, root 0x4CABC; the game RT
shadow CS returns the CPU walker's children in the same order on the RTX 2060.
On a GPU without a D24 attachment (AMD) the layer stores D24_UNORM_S8_UINT as
D32_SFLOAT_S8_UINT. Draws then broke two D3D rules: the integer DepthBias was
scaled by the primitive's exponent instead of D24 units, and fragment depth was
not quantised like the clears, so an EQUAL test at a cleared value failed.
Single-sampled graphics pipelines with depth enabled on such a target now have
their pixel stage write FragDepth = quantise(z + D3D bias), with the bias in D24
units and the quantisation of depth24_convert.comp; the rasterizer's own bias is
off for them. A pipeline without a pixel shader, with or without a geometry
shader, gets a built-in one. d3d12_depth24_draw_test covers the finding's cases,
stored depth with constant and slope-scaled bias, a shader that writes depth, and
a VS + GS pipeline without a pixel shader.
Co-authored-by: UlteriorMotive00 <132296248+UlteriorMotive00@users.noreply.github.com>
With a `keep` vector and ReplayFunctions::create_segment_pool (plus the sum
helpers), replay() makes one occlusion and one pipeline-statistics segment pool
sized to the list, plans them as the batched path does and hands them to the
caller, instead of refusing a list whose queries overlap. Without them the list
is still refused. replay_query_predication_test case 14 checks both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The breakdown kept from the first marker scan (9,930 PS, 8,666 mesh,
1,115 VS, 923 CS) adds up to 20,634, not to the 21,545 or 21,538 the
row attributes to the markers (review by @kapitche). The row now gives
the per-stage split of the 21,538 measured at 6a6704df (10,031 PS,
9,282 mesh, 1,179 VS, 851 CS, 195 GS; the 16 refused then are wave64
CS by the flag) and says where the older figures came from.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Folds #1790's 22-archive run into rpf.md: 177,087 of 1,489,677 streams named (11.89%), coverage by stream
type, and its three findings (paths come from the payload, stream alignment differs per archive, anim.rpf
is the richest). Marked as reported there, not re-run; no paths or names copied.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/navmesh.md left the polygon flag bits open and two road/pavement
labels from another project unconfirmed. tools/navmesh_nodes.py puts
every lane-graph node of levels.rpf on the navmesh polygon under it and
counts that polygon's +0x18 and +0x28 bits next to the plan area each
bit covers.
On one 1.0.2.1 package 63,793 of 63,806 nodes have a polygon within 3 m
(median 0.03 m), which confirms vertex = tile minimum + u16 / 65535 *
extent; 90.2% of them stand on a polygon with +0x18 bit 13, which covers
12.0% of the area: road surface, as SixNG labels it from a visual check.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Walks the fragment drawable array (u16 at +0x30 records, 0x110-byte stride) and scans the system pages for
other drawable bodies, over any plain RPF9 archive, with --jobs/--start/--end. Synthetic tests only.
docs/character_models.md: levels.rpf and data.rpf counts next to the packs.rpf ones.
docs/design.md had two rows for the same no-op SOPP/SMEM rule (the shorter one lacked s_atc_probe/s_atc_probe_buffer) and two Scalar select and pack rows, the stale one still saying s_cmov_b64 is Unsupported. Keep the complete rows, merge the s_cmov_b64 support text with the gfx1035/gfx1036 evidence, and drop the duplicates.
Follow-up to #2309, which found the two texture sources (embedded 0x980 textures and the companion ttdb
pools). Over the 1,732 drawables of the two core archives (17,208 references, 675 distinct 64-bit IDs):
543 IDs are in a pool (285 core, 258 shared data/ttdb; 6,403 references), none is a key of the 144
embedded dictionaries or appears in the 145 embedded-texture streams, and 132 (10,805 references) are in
no source. By slot, colour/normal/specular resolve for 93/89/85% of references; most unresolved references
come from six slots with one fixed ID each. Counts only; no IDs, names or slot hashes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wave64 programs get v_*_co(_ci)_u32 through SGPR pairs and VCC, ds_bpermute_b32,
ds_permute_b32, ds_swizzle_b32, lane selects of 64 and up, the b64 mask ops with
an SCC probe, the saveexec/wrexec family, s_bfm_b64, s_wqm_b64 and SI_LOOP-shaped
loops. Seeds without the flag, and wave32 programs, are unchanged. The model was
checked on RDNA2 (gfx1036): 100/100 programs.
AI-assisted.