diff --git a/docs/replay-format.md b/docs/replay-format.md index bc5ca2053..dadbacfaa 100644 --- a/docs/replay-format.md +++ b/docs/replay-format.md @@ -41,7 +41,7 @@ first byte. ```jsonc { - "decoder": { "name": "icarus_replay", "version": "0.3.5+vrfkit.0.4.0", "vrfkit": "0.4.0" }, + "decoder": { "name": "icarus_replay", "version": "0.3.6+vrfkit.0.5.0-6194bde", "vrfkit": "0.5.0-6194bde" }, "match": { "id": "dc078274-2d68-495b-8321-5e58b2a3eeba", "mapPath": "/Game/Maps/Juliett/Juliett", @@ -316,7 +316,7 @@ the first). A clean replay has none. "durationMs": 321499, "recordedAt?": "2026-07-08T00:35:45Z", "supported": true, // a payload transform is registered for the build - "decoderVersion": "0.3.5+vrfkit.0.4.0", // same as the document's decoder.version + "decoderVersion": "0.3.6+vrfkit.0.5.0-6194bde", // same as the document's decoder.version "players": [{ "subject": "…", "agentId": "…" }] } ``` diff --git a/native/replay/Cargo.lock b/native/replay/Cargo.lock index de610ea51..e9a7ae7d7 100644 --- a/native/replay/Cargo.lock +++ b/native/replay/Cargo.lock @@ -58,7 +58,7 @@ dependencies = [ [[package]] name = "icarus_replay" -version = "0.3.5" +version = "0.3.6" dependencies = [ "serde", "serde_json", @@ -224,13 +224,13 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vrf-bitio" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" [[package]] name = "vrf-container" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "thiserror", "vrf-bitio", @@ -238,8 +238,8 @@ dependencies = [ [[package]] name = "vrf-decode" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "thiserror", "vrf-bitio", @@ -247,8 +247,8 @@ dependencies = [ [[package]] name = "vrf-export" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "smallvec", "thiserror", @@ -256,8 +256,8 @@ dependencies = [ [[package]] name = "vrf-frame" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "thiserror", "vrf-bitio", @@ -266,8 +266,8 @@ dependencies = [ [[package]] name = "vrf-movement" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "thiserror", "vrf-bitio", @@ -275,8 +275,8 @@ dependencies = [ [[package]] name = "vrf-net" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "thiserror", "vrf-bitio", @@ -286,8 +286,8 @@ dependencies = [ [[package]] name = "vrf-schema" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "thiserror", "vrf-bitio", @@ -296,12 +296,12 @@ dependencies = [ [[package]] name = "vrf-testkit" version = "0.0.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" [[package]] name = "vrf-transform" -version = "0.4.0" -source = "git+https://github.com/yakisoba0728/vrfkit?tag=v0.4.0#b9ba3f70735c7219fef41ba61a80626a4bb88757" +version = "0.5.0" +source = "git+https://github.com/yakisoba0728/vrfkit?rev=6194bdeece2e64eac1c2c10beb6aab6dc53e8d34#6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" dependencies = [ "vrf-bitio", ] diff --git a/native/replay/Cargo.toml b/native/replay/Cargo.toml index 6e9156841..98f8ebd51 100644 --- a/native/replay/Cargo.toml +++ b/native/replay/Cargo.toml @@ -3,7 +3,7 @@ name = "icarus_replay" # Bump whenever the decoded output could change: Icarus keys its cache of # decoded replays by it (header::DECODER_VERSION), so an unchanged version # serves the old output. -version = "0.3.5" +version = "0.3.6" edition = "2024" rust-version = "1.86" license = "Apache-2.0" @@ -23,18 +23,19 @@ dev-vectors = ["dep:sha2"] name = "icarus-replay-dump" path = "src/bin/icarus-replay-dump.rs" -# vrfkit v0.4.0 (b9ba3f7). `vrf-container` keeps its `oodle` feature off so the +# vrfkit 6194bde: v0.5.0 plus vrfkit PR #45 (VALORANT 13.10), not yet tagged. +# Move to the release tag once one carries 13.10. `vrf-container` keeps its `oodle` feature off so the # GPL-derived oozextract never enters the build; decompression is ours (src/oodle.rs). [dependencies] -vrf-bitio = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0" } -vrf-container = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0", default-features = false, features = ["event"] } -vrf-schema = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0", default-features = false } -vrf-net = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0" } -vrf-frame = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0" } -vrf-movement = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0" } -vrf-decode = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0" } -vrf-transform = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0" } -vrf-export = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0", default-features = false } +vrf-bitio = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" } +vrf-container = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34", default-features = false, features = ["event"] } +vrf-schema = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34", default-features = false } +vrf-net = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" } +vrf-frame = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" } +vrf-movement = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" } +vrf-decode = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" } +vrf-transform = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" } +vrf-export = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34", default-features = false } smallvec = { version = "1", features = ["union"] } thiserror = "2" serde = { version = "1", features = ["derive"] } @@ -42,7 +43,7 @@ serde_json = "1" sha2 = { version = "0.10", optional = true } [dev-dependencies] -vrf-testkit = { git = "https://github.com/yakisoba0728/vrfkit", tag = "v0.4.0" } +vrf-testkit = { git = "https://github.com/yakisoba0728/vrfkit", rev = "6194bdeece2e64eac1c2c10beb6aab6dc53e8d34" } [profile.release] opt-level = 3 diff --git a/native/replay/NOTICE.md b/native/replay/NOTICE.md index 07ea5e0aa..aec36ddda 100644 --- a/native/replay/NOTICE.md +++ b/native/replay/NOTICE.md @@ -1,7 +1,8 @@ # Notices `native/replay` depends on the vrfkit library crates -(, tag v0.4.0, commit b9ba3f7) and +(, commit 6194bde: tag v0.5.0 plus +the VALORANT 13.10 support in vrfkit pull request #45) and vendors code from its CLI crate into `src/vendor/` (each file names its source). vrfkit's NOTICE.md follows verbatim; the full Apache License 2.0 text is the repository's `LICENSE`, the same as vrfkit's. diff --git a/native/replay/src/header.rs b/native/replay/src/header.rs index 3c8ed353a..a1b142c16 100644 --- a/native/replay/src/header.rs +++ b/native/replay/src/header.rs @@ -13,8 +13,8 @@ use crate::error::{ErrorCode, ReplayError}; /// Changes whenever the decoded output could: our version plus vrfkit's tag. /// The Dart cache keys decoded replays by it. -pub const DECODER_VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), "+vrfkit.0.4.0"); -pub const VRFKIT_VERSION: &str = "0.4.0"; +pub const DECODER_VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), "+vrfkit.0.5.0-6194bde"); +pub const VRFKIT_VERSION: &str = "0.5.0-6194bde"; /// The facts the probe returns (docs/replay-format.md, "Probe"). #[derive(Debug, Clone, Serialize)] @@ -188,7 +188,7 @@ mod tests { #[test] fn decoder_version_names_both_versions() { - assert_eq!(DECODER_VERSION, "0.3.5+vrfkit.0.4.0"); + assert_eq!(DECODER_VERSION, "0.3.6+vrfkit.0.5.0-6194bde"); assert!(DECODER_VERSION.ends_with(VRFKIT_VERSION)); } diff --git a/native/replay/src/vendor/frame.rs b/native/replay/src/vendor/frame.rs index 185eed052..920def7e8 100644 --- a/native/replay/src/vendor/frame.rs +++ b/native/replay/src/vendor/frame.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrf-frame/src/lib.rs and +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrf-frame/src/lib.rs and // sections.rs. Apache-2.0; see native/replay/NOTICE.md. Local edits: // `walk_demo_frames` takes a `before_exports` hook that sees each frame's // ExportData before the cache applies it, both callbacks return `false` to diff --git a/native/replay/src/vendor/mod.rs b/native/replay/src/vendor/mod.rs index 13b2d8f5e..2341cd8dc 100644 --- a/native/replay/src/vendor/mod.rs +++ b/native/replay/src/vendor/mod.rs @@ -1,4 +1,4 @@ -//! Code vendored from vrfkit v0.4.0 (b9ba3f7, Apache-2.0; NOTICE.md), kept +//! Code vendored from vrfkit 6194bde (v0.5.0 + PR #45, Apache-2.0; NOTICE.md), kept //! apart from ours so a vrfkit bump is a readable diff: re-copy the source //! files over these and re-apply the edits listed here. //! diff --git a/native/replay/src/vendor/pass.rs b/native/replay/src/vendor/pass.rs index 98173a72e..0b3d5d734 100644 --- a/native/replay/src/vendor/pass.rs +++ b/native/replay/src/vendor/pass.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/pass.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/pass.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: `Replay`, `for_each_chunk` and the // checkpoint block scope are dropped (crate::decode walks the chunks), the // CLI error type is replaced by `vrf_frame::FrameError`, and `walk` runs our diff --git a/native/replay/src/vendor/sink/blobs.rs b/native/replay/src/vendor/sink/blobs.rs index 208602d2a..406d4ba28 100644 --- a/native/replay/src/vendor/sink/blobs.rs +++ b/native/replay/src/vendor/sink/blobs.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/blobs.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/blobs.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! Additive decoders for two payload shapes the field stream hands over whole: @@ -14,8 +14,8 @@ use smallvec::SmallVec; use vrf_bitio::BitReader; use vrf_decode::{ - ABILITY_CASTS_SCHEMA, ArrayDecodeStats, COMBAT_ROUNDS_SCHEMA, EffectArrayKind, FieldType, - FlattenedField, structs, + ABILITY_CASTS_SCHEMA, ArrayDecodeStats, COMBAT_ROUNDS_SCHEMA, COMBAT_ROUNDS_SCHEMA_1310, + EffectArrayKind, FieldType, FlattenedField, structs, }; use vrf_schema::NetGuidCache; @@ -484,10 +484,11 @@ impl ExportSink<'_> { }; let flattened = match route { None => { - let schema = if kind == ArrayKind::Rounds { - &COMBAT_ROUNDS_SCHEMA - } else { - &ABILITY_CASTS_SCHEMA + let schema = match kind { + ArrayKind::Rounds if self.release_1310_layouts => &COMBAT_ROUNDS_SCHEMA_1310, + ArrayKind::Rounds => &COMBAT_ROUNDS_SCHEMA, + ArrayKind::AbilityCasts => &ABILITY_CASTS_SCHEMA, + ArrayKind::Measured(_) => unreachable!("measured route handled separately"), }; vrf_decode::decode_struct_array( raw, diff --git a/native/replay/src/vendor/sink/failure_stats.rs b/native/replay/src/vendor/sink/failure_stats.rs index 07f48f65b..5ece9bdb5 100644 --- a/native/replay/src/vendor/sink/failure_stats.rs +++ b/native/replay/src/vendor/sink/failure_stats.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/failure_stats.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/failure_stats.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! The opt-in, bounded aggregate of stream failures. Only `diag` enables and diff --git a/native/replay/src/vendor/sink/intern.rs b/native/replay/src/vendor/sink/intern.rs index 9f6a4502b..6c0e89fdb 100644 --- a/native/replay/src/vendor/sink/intern.rs +++ b/native/replay/src/vendor/sink/intern.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/intern.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/intern.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! A string pool for the two name columns of `fields.parquet`: a row's name diff --git a/native/replay/src/vendor/sink/measured_routes.rs b/native/replay/src/vendor/sink/measured_routes.rs index 3b8a086ea..31c027b03 100644 --- a/native/replay/src/vendor/sink/measured_routes.rs +++ b/native/replay/src/vendor/sink/measured_routes.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/measured_routes.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/measured_routes.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! Which checksum-gated structured-array routes a replay branch admits. @@ -81,10 +81,12 @@ impl MeasuredArrayRoutes { /// - `SelectedV2` 11.06-11.08: a zero-width `DynamicMappings` at 13 moves the nested array. /// - `ActiveBlinds`, every legacy build: `SourceID`/`EffectID` swapped through 12.04, /// 9-bit hardcoded-name `SourceID`s from 12.05; refusals move `array_leaf_decode_errors`. - /// - Any route with no child observed on a build (the path on 11.06, 12.06, 12.07). + /// - Any route with no child observed on a build (the path on 11.06, 12.06, 12.07, 13.08). + /// + /// 13.08 rests on one replay and 13.09 on two, main stream and checkpoints. pub(super) fn for_branch(branch: &str) -> Self { use MeasuredArrayRoute::{ - AllPlayersObfuscatedPlayerInformation as PlayerInfo, KillData, + ActiveBlinds, AllPlayersObfuscatedPlayerInformation as PlayerInfo, KillData, NetworkedProjectilePath as ProjectilePath, RequestedIgnoreActors, SelectedV2, ServerActiveEffects, TrackedRewards, }; @@ -141,7 +143,18 @@ impl MeasuredArrayRoutes { | "++Ares-Core+release-13.02" | "++Ares-Core+release-13.04" | "++Ares-Core+release-13.05" - | "++Ares-Core+release-13.06" => Self::ALL, + | "++Ares-Core+release-13.06" + | "++Ares-Core+release-13.09" => Self::ALL, + // The one sample declares no MulticastSetPath group: the path is unobserved. + "++Ares-Core+release-13.08" => Self::of(&[ + PlayerInfo, + TrackedRewards, + SelectedV2, + KillData, + ServerActiveEffects, + RequestedIgnoreActors, + ActiveBlinds, + ]), _ => Self::NONE, } } @@ -210,6 +223,16 @@ mod tests { ]; /// 12.10, 12.11 and 13.00: the only four routes their one fixture holds. const FIXTURE: &[Route] = &[PlayerInfo, TrackedRewards, SelectedV2, ServerActiveEffects]; + /// 13.08: every route but the path, which its one sample never declares. + const B1308: &[Route] = &[ + PlayerInfo, + TrackedRewards, + SelectedV2, + KillData, + ServerActiveEffects, + RequestedIgnoreActors, + ActiveBlinds, + ]; /// Every supported branch and the routes it admits, in the order of /// `vrf_transform::ALL_VERSIONS`. A change to the gate is a change to this @@ -239,8 +262,10 @@ mod tests { ("++Ares-Core+release-13.04", ALL), ("++Ares-Core+release-13.05", ALL), ("++Ares-Core+release-13.06", ALL), - ("++Ares-Core+release-13.08", &[]), - ("++Ares-Core+release-13.09", &[]), + ("++Ares-Core+release-13.08", B1308), + ("++Ares-Core+release-13.09", ALL), + // No array route has been independently measured on 13.10 yet. + ("++Ares-Core+release-13.10", &[]), ]; #[test] diff --git a/native/replay/src/vendor/sink/mod.rs b/native/replay/src/vendor/sink/mod.rs index 27b25afcb..299a7726f 100644 --- a/native/replay/src/vendor/sink/mod.rs +++ b/native/replay/src/vendor/sink/mod.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/mod.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/mod.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! Sink implementation connecting `vrf-net` events to `vrf-export` records. @@ -563,6 +563,8 @@ pub struct ExportSink<'a> { /// The checksum-gated structured-array routes this replay's branch admits. /// See [`measured_routes`]; empty until `enable_measured_array_routes`. measured_array_routes: MeasuredArrayRoutes, + /// Exact release gate for the changed nested-array layouts measured on 13.10. + release_1310_layouts: bool, checkpoint_block_scope: Option<(CheckpointIdentity, u64, u32)>, // -- per-content-block context (set by on_content_block) ---------------- @@ -606,6 +608,7 @@ impl<'a> ExportSink<'a> { records, stats: ExportStats::default(), measured_array_routes: MeasuredArrayRoutes::NONE, + release_1310_layouts: false, checkpoint_block_scope: None, current_channel: 0, current_actor_guid: 0, @@ -622,6 +625,7 @@ impl<'a> ExportSink<'a> { /// Admit the structured-array routes measured for `branch` ([`measured_routes`]). pub(super) fn enable_measured_array_routes(&mut self, branch: &str) { self.measured_array_routes = MeasuredArrayRoutes::for_branch(branch); + self.release_1310_layouts = branch == "++Ares-Core+release-13.10"; } /// Whether `route` may expand its parent in this replay. diff --git a/native/replay/src/vendor/sink/paths.rs b/native/replay/src/vendor/sink/paths.rs index 783b56c53..652f398fd 100644 --- a/native/replay/src/vendor/sink/paths.rs +++ b/native/replay/src/vendor/sink/paths.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/paths.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/paths.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! Content-block group-path resolution. diff --git a/native/replay/src/vendor/sink/rpc.rs b/native/replay/src/vendor/sink/rpc.rs index 3b7aa690c..a426a9a48 100644 --- a/native/replay/src/vendor/sink/rpc.rs +++ b/native/replay/src/vendor/sink/rpc.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/rpc.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/rpc.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! The ClassNetCache RPC payload walker. A ClassNetCache block carries function @@ -13,9 +13,9 @@ use smallvec::{SmallVec, smallvec}; use vrf_bitio::BitReader; use vrf_decode::{ ArrayFieldSchema, DecodeErrorKind, EffectArrayKind, EffectBlobError, FieldType, - LIFE_CHANGE_BY_SECTION_SCHEMA, LIFE_CHANGE_DAMAGE_SCHEMA, LIFE_CHANGE_SECTION_SCHEMA, - apply_overlay_with_checksum, decode_effect_blob_json, decode_struct_array, - decode_struct_array_exact, group_hash_state, + LIFE_CHANGE_BY_SECTION_SCHEMA, LIFE_CHANGE_DAMAGE_SCHEMA, LIFE_CHANGE_DAMAGE_SCHEMA_1310, + LIFE_CHANGE_SECTION_SCHEMA, apply_overlay_with_checksum, decode_effect_blob_json, + decode_struct_array, decode_struct_array_exact, group_hash_state, }; use vrf_schema::{FxHashMap, NetGuidCache}; @@ -232,7 +232,7 @@ impl ExportSink<'_> { // purpose. That gate ranks decodes of the same bits; this pass only // adds rows, so typing the parent one day must not stop the children. if let (Some(schema), Some(raw)) = ( - life_change_schema_for_param(func_name, param_name), + life_change_schema_for_param(func_name, param_name, self.release_1310_layouts), raw_bits.as_deref(), ) { self.emit_life_change_array( @@ -515,7 +515,9 @@ pub(super) fn copy_raw_bits( /// Which life-change schema an RPC parameter takes, if any. Keyed on the /// function too: each struct array has its own handle space, so the same four -/// members sit at 10-13, 1-4 or 2-5. `MulticastNotifyHeal` and +/// members sit at 10-13, 1-4 or 2-5. The damage RPCs on 13.10 shift their +/// four members to 11-14. +/// `MulticastNotifyHeal` and /// `MulticastNotifyOverhealDecay`, more than half the calls, name theirs /// `LifeChangeBySection`, not `LifeChangeEvents`. /// `MulticastReceivePlayerTemporaryDeathEvent_Point` and @@ -524,8 +526,14 @@ pub(super) fn copy_raw_bits( fn life_change_schema_for_param( function_name: &str, param_name: Option<&str>, + release_1310_layouts: bool, ) -> Option<&'static ArrayFieldSchema> { match (function_name, param_name?) { + ("MulticastNotifyDamage_Point" | "MulticastNotifyDamage_Base", "LifeChangeEvents") + if release_1310_layouts => + { + Some(&LIFE_CHANGE_DAMAGE_SCHEMA_1310) + } ("MulticastNotifyDamage_Point" | "MulticastNotifyDamage_Base", "LifeChangeEvents") => { Some(&LIFE_CHANGE_DAMAGE_SCHEMA) } diff --git a/native/replay/src/vendor/sink/stream.rs b/native/replay/src/vendor/sink/stream.rs index e924564fa..fdbb51096 100644 --- a/native/replay/src/vendor/sink/stream.rs +++ b/native/replay/src/vendor/sink/stream.rs @@ -1,4 +1,4 @@ -// Vendored from vrfkit v0.4.0 (b9ba3f7), crates/vrfkit/src/sink/stream.rs. Apache-2.0; +// Vendored from vrfkit 6194bde (v0.5.0 + PR #45), crates/vrfkit/src/sink/stream.rs. Apache-2.0; // see native/replay/NOTICE.md. Local edits: listed in src/vendor/mod.rs. //! The `vrf-net` callbacks: `FieldSink` takes replicated properties and RPCs, diff --git a/native/replay/tests/corpus.rs b/native/replay/tests/corpus.rs index abf896dd0..118a11326 100644 --- a/native/replay/tests/corpus.rs +++ b/native/replay/tests/corpus.rs @@ -100,8 +100,9 @@ fn every_replay_decodes_to_the_contract() { let rounds = doc["rounds"].as_array().unwrap(); let kills = doc["kills"].as_array().unwrap(); check_event_counts(&id, &event_counts(&path), rounds, kills); - check_score(&id, rounds); - check_sides(&id, rounds, kills, &team); + let format = Format::of(doc["match"]["gameMode"].as_str().unwrap_or("")); + check_score(&id, format, rounds); + check_sides(&id, format, rounds, kills, &team); check_vitals(&id, &doc, rounds, kills, &team); check_movement(&id, &doc, parts.blob, &team); check_utility(&id, doc["utility"].as_array().unwrap()); @@ -235,14 +236,44 @@ fn check_event_counts( ); } -/// Winners follow the score: no round is played once a team has 13 with a -/// two-round lead, and the last round decides the match unless it was -/// surrendered or the replay stops inside it. -fn check_score(id: &str, rounds: &[Value]) { +/// How a mode's match is won and when its sides switch. +#[derive(Clone, Copy)] +struct Format { + /// Rounds a team needs to win. + wins: u32, + /// Rounds before the first side switch. + half: usize, + /// Tied at `wins - 1` each, rounds alternate sides until a two-round + /// lead; without overtime the next round decides. + overtime: bool, +} + +impl Format { + fn of(game_mode: &str) -> Self { + if game_mode.contains("Swiftplay") { + Self { + wins: 5, + half: 4, + overtime: false, + } + } else { + Self { + wins: 13, + half: 12, + overtime: true, + } + } + } +} + +/// Winners follow the score: no round is played once a team has won the +/// match, and the last round decides the match unless it was surrendered or +/// the replay stops inside it. +fn check_score(id: &str, format: Format, rounds: &[Value]) { let mut score: HashMap<&str, u32> = HashMap::from([("Red", 0), ("Blue", 0)]); let decided = |s: &HashMap<&str, u32>| { let (r, b) = (s["Red"], s["Blue"]); - r.max(b) >= 13 && r.abs_diff(b) >= 2 + r.max(b) >= format.wins && (!format.overtime || r.abs_diff(b) >= 2) }; for (i, r) in rounds.iter().enumerate() { assert_eq!(r["index"], i); @@ -266,15 +297,24 @@ fn check_score(id: &str, rounds: &[Value]) { ); } -/// Sides switch after 12 rounds and every overtime round; the teams' own -/// acts agree: attackers plant, defenders defuse, no one kills a teammate. -fn check_sides(id: &str, rounds: &[Value], kills: &[Value], team: &HashMap<&str, &str>) { +/// Sides switch after the first half and every overtime round; the teams' +/// own acts agree: attackers plant, defenders defuse, no one kills a teammate. +fn check_sides( + id: &str, + format: Format, + rounds: &[Value], + kills: &[Value], + team: &HashMap<&str, &str>, +) { let first = rounds[0]["attackingTeam"].as_str().unwrap(); + let half = format.half; for (i, r) in rounds.iter().enumerate() { - let swapped = match i { - 0..12 => false, - 12..24 => true, - _ => (i - 24) % 2 == 1, + let swapped = if i < half { + false + } else if i < 2 * half || !format.overtime { + true + } else { + (i - 2 * half) % 2 == 1 }; let attackers = r["attackingTeam"].as_str().unwrap(); assert_eq!(attackers != first, swapped, "{id}: round {i} attackers");