Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-stryker": {
"version": "5.0.0",
"version": "5.1.0",
"commands": [
"dotnet-stryker"
],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
fetch-depth: 0

- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: 10.0.403
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: 10.0.403
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: 10.0.403
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
ref: ${{ github.sha }}

- name: Set up .NET from global.json
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: 10.0.403
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: 10.0.403
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
timeout-minutes: 195
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: 10.0.403
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
fetch-depth: 0

- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: |
Expand Down Expand Up @@ -416,7 +416,7 @@ jobs:
- name: Confirm npm publication integrity
run: node tools/release/npm-release.mjs --require-published
- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
# An exact version skips the aka.ms redirect of dotnet-install, which points at a retired storage account (HTTP 409).
dotnet-version: 10.0.403
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ Related changes are consolidated; routine formatting and benchmark bookkeeping a
headings in this order and omits the empty ones: *Breaking changes* (each with its
migration), *Added*, *Changed*, *Fixed*, *Performance*, and *Documentation and tooling*.

## Unreleased

### Breaking changes

- `StructValue.Add`, `ContainsKey`, `Remove` and `TryGetValue` name their first parameter `key`, matching the
dictionary interfaces they implement and `UnionValue`. Migration: callers that pass it as a named argument write
`key:` instead of `name:`; positional calls are unchanged.

### Added

- The Inspector recognizes Apple Core Audio Format (`.caf`) and DSDIFF (`.dff`) files, newly detected by `file-type`
22.3.0, and shows each file header with its required first chunk (`desc` and `FVER`).

### Documentation and tooling

- Update build, test, documentation, benchmark and app dependencies to their latest compatible releases, including
StyleCop.Analyzers 1.3.180, MSTest 4.5.3, Stryker.NET 5.1.0, Vite 8.3.8, Vitest 5.1.0, ESLint 10.15.0, Playwright
1.65.1, cspell 10.5.1, markdownlint-cli2 0.24.1 and `actions/setup-dotnet` 6.1.0. Source documentation now meets
StyleCop 1.3's rules for record parameters and partial types; the changed-documentation check accepts `<content>`
on secondary partial declarations. The markdownlint-cli2 update removes a high-severity `re2js` advisory
(GHSA-gg6h-894w-4m9c) from the documentation toolchain.

## 0.18.0 — 2026-10-28

### Added
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PackageReference Include="StyleCop.Analyzers" Version="1.3.180">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,44 +361,44 @@ reproduction commands, and the separate comparison against 0.11.1, including unc

<!-- comparison-benchmarks:start -->

Measured on AMD Ryzen 9 9950X, Windows 11, .NET 10.0.12, with BenchmarkDotNet 0.15.8 (`default` job) on 2026-10-04. Times are medians for one record; each table lists the fastest deserializer first.
Measured on AMD Ryzen 9 9950X, Windows 11, .NET 10.0.15, with BenchmarkDotNet 0.15.8 (`default` job) on 2026-11-16. Times are medians for one record; each table lists the fastest deserializer first.

**Same bytes: the 79-byte C layout**

| Approach | Deserialize | Allocated | Serialize | Allocated |
| ----------------------------------------------------------------------------- | ----------: | --------: | --------: | --------: |
| CStructSharp generated view | 8.2 ns | 0 B | — | — |
| .NET `MemoryMarshal.Read` / `Write` | 8.7 ns | 0 B | 0.2 ns | 0 B |
| CStructSharp generated `Parse` / `Serialize` | 15.5 ns | 184 B | 8.4 ns | 0 B |
| Hand-written `BinaryPrimitives` | 16.8 ns | 248 B | 5.2 ns | 0 B |
| CStructSharp runtime view (`CreateView` + accessors) | 28.9 ns | 0 B | — | — |
| CStructSharp runtime `ReadValue<T>` / `Serialize` (layout-bound mapped class) | 30.3 ns | 248 B | 19.8 ns | 0 B |
| .NET `BinaryReader` / `BinaryWriter` | 35.8 ns | 248 B | 40.0 ns | 0 B |
| .NET `Marshal.PtrToStructure` / `StructureToPtr` | 50.1 ns | 128 B | 30.2 ns | 72 B |
| Kaitai Struct 0.11.0 | 117 ns | 1,040 B | — | — |
| CStructSharp runtime `Parse` + accessors | 127 ns | 672 B | — | — |
| CStructSharp runtime `Parse` / `Serialize` (`StructValue`, path strings) | 329 ns | 672 B | 52.9 ns | 0 B |
| .NET `MemoryMarshal.Read` / `Write` | 7.5 ns | 0 B | 0.2 ns | 0 B |
| CStructSharp generated view | 8.5 ns | 0 B | — | — |
| Hand-written `BinaryPrimitives` | 17.8 ns | 248 B | 5.4 ns | 0 B |
| CStructSharp generated `Parse` / `Serialize` | 18.6 ns | 184 B | 8.8 ns | 0 B |
| CStructSharp runtime view (`CreateView` + accessors) | 29.6 ns | 0 B | — | — |
| CStructSharp runtime `ReadValue<T>` / `Serialize` (layout-bound mapped class) | 32.9 ns | 248 B | 20.9 ns | 0 B |
| .NET `BinaryReader` / `BinaryWriter` | 39.3 ns | 248 B | 40.2 ns | 0 B |
| .NET `Marshal.PtrToStructure` / `StructureToPtr` | 53.3 ns | 128 B | 30.4 ns | 72 B |
| CStructSharp runtime `Parse` + accessors | 135 ns | 672 B | — | — |
| Kaitai Struct 0.11.0 | 152 ns | 1,040 B | — | — |
| CStructSharp runtime `Parse` / `Serialize` (`StructValue`, path strings) | 363 ns | 672 B | 55.4 ns | 0 B |

**Same record, each library's own format**

| Library | Format | Size | Deserialize | Allocated | Serialize | Allocated |
| -------------------------------------------- | ---------------- | ----: | ----------: | --------: | --------: | --------: |
| CStructSharp generated `Parse` / `Serialize` | C layout | 79 B | 15.5 ns | 184 B | 8.4 ns | 0 B |
| FlatSharp 7.9.0 (lazy) | FlatBuffers | 116 B | 27.8 ns | 240 B | 46.1 ns | 0 B |
| MemoryPack 1.21.4 | MemoryPack | 86 B | 31.9 ns | 248 B | 17.3 ns | 0 B |
| MessagePack-CSharp 3.1.12 | MessagePack | 74 B | 110 ns | 248 B | 55.6 ns | 0 B |
| protobuf-net 3.4.30 | Protocol Buffers | 91 B | 227 ns | 184 B | 221 ns | 0 B |
| System.Text.Json (source-generated) | JSON | 207 B | 641 ns | 848 B | 355 ns | 0 B |
| CStructSharp generated `Parse` / `Serialize` | C layout | 79 B | 18.6 ns | 184 B | 8.8 ns | 0 B |
| FlatSharp 7.9.0 (lazy) | FlatBuffers | 116 B | 31.4 ns | 240 B | 47.0 ns | 0 B |
| MemoryPack 1.22.0 | MemoryPack | 86 B | 34.5 ns | 248 B | 18.5 ns | 0 B |
| MessagePack-CSharp 3.1.12 | MessagePack | 74 B | 111 ns | 248 B | 55.9 ns | 0 B |
| protobuf-net 3.4.40 | Protocol Buffers | 91 B | 246 ns | 184 B | 214 ns | 0 B |
| System.Text.Json (source-generated) | JSON | 207 B | 707 ns | 848 B | 370 ns | 0 B |

**A record whose shape depends on its data (the `packet` layout above)**

| Approach | Deserialize | Allocated | Serialize | Allocated |
| ---------------------------------------------------------------------- | ----------: | --------: | --------: | --------: |
| Hand-written `BinaryPrimitives` | 24.6 ns | 208 B | 8.7 ns | 0 B |
| CStructSharp generated `Parse` / `Serialize` | 48.7 ns | 200 B | 28.6 ns | 0 B |
| CStructSharp runtime `Parse` + accessors / `Serialize` (`StructValue`) | 367 ns | 432 B | 237 ns | 0 B |
| CStructSharp runtime `Parse` from a `MemoryStream` + accessors | 530 ns | 592 B | — | — |
| CStructSharp runtime `ReadValue<T>` / `Serialize` (mapped class) | 532 ns | 552 B | 396 ns | 272 B |
| Hand-written `BinaryPrimitives` | 23.4 ns | 208 B | 8.3 ns | 0 B |
| CStructSharp generated `Parse` / `Serialize` | 50.2 ns | 200 B | 27.2 ns | 0 B |
| CStructSharp runtime `Parse` + accessors / `Serialize` (`StructValue`) | 368 ns | 432 B | 245 ns | 0 B |
| CStructSharp runtime `ReadValue<T>` / `Serialize` (mapped class) | 531 ns | 552 B | 359 ns | 272 B |
| CStructSharp runtime `Parse` from a `MemoryStream` + accessors | 538 ns | 592 B | — | — |

<!-- comparison-benchmarks:end -->

Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@cstructsharp/app-shared": "*",
"monaco-editor": "^0.57.0",
"vue": "^3.5.44",
"vue": "^3.5.45",
"vuehex": "^0.7.0"
}
}
10 changes: 5 additions & 5 deletions apps/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
},
"dependencies": {
"@cstructsharp/app-shared": "*",
"@iconify-icons/vscode-icons": "^2.0.17",
"@iconify/vue": "^5.0.3",
"@iconify-icons/vscode-icons": "^2.0.26",
"@iconify/vue": "^5.0.5",
"@vueuse/core": "^15.0.0",
"dockview-vue": "^8.6.0",
"file-type": "22.1.1",
"dockview-vue": "^8.9.0",
"file-type": "22.3.0",
"json-editor-vue": "^0.19.2",
"monaco-editor": "^0.57.0",
"vanilla-jsoneditor": "^3.13.0",
"vue": "^3.5.44",
"vue": "^3.5.45",
"vuehex": "^0.7.0"
}
}
32 changes: 32 additions & 0 deletions apps/inspector/src/schema-catalog/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,38 @@ uint64 chunk_size;
uint64 file_size;
uint64 metadata_offset;`,
},
{
extensions: ["dff"],
family: "DSDIFF",
scope:
"DSDIFF FRM8 form header and the required first FVER version chunk. Later property and sound-data chunks are not followed.",
fields: `char signature[4];
uint64 form_size;
char form_type[4];
char version_chunk_type[4];
uint64 version_chunk_size;
uint32 format_version;`,
littleEndian: false,
},
{
extensions: ["caf"],
family: "Core Audio Format",
scope:
"CAF file header and the required first audio description chunk. Later chunks and audio packets are not followed.",
fields: `char signature[4];
uint16 file_version;
uint16 file_flags;
char description_chunk_type[4];
int64 description_chunk_size;
float64 sample_rate;
char format_id[4];
uint32 format_flags;
uint32 bytes_per_packet;
uint32 frames_per_packet;
uint32 channels_per_frame;
uint32 bits_per_channel;`,
littleEndian: false,
},
{
extensions: ["wv"],
family: "WavPack",
Expand Down
4 changes: 2 additions & 2 deletions apps/inspector/tests/e2e/schema-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test("all detector types are listed and the filter searches extensions and names
}) => {
await page.goto("/");
const list = page.getByRole("navigation", { name: "Binary format examples" }).locator("ul");
await expect(list.getByRole("button")).toHaveCount(185);
await expect(list.getByRole("button")).toHaveCount(187);
const labels = await list.locator(".example-title").allTextContents();
for (const extension of supportedExtensions) expect(labels).toContain(extension.toUpperCase());
const filter = page.getByRole("searchbox", { name: "Filter file types" });
Expand All @@ -18,7 +18,7 @@ test("all detector types are listed and the filter searches extensions and names
await filter.fill("no-such-file-type");
await expect(page.getByText("No matching file types.")).toBeVisible();
await page.getByRole("button", { name: "Clear file type filter" }).click();
await expect(list.getByRole("button")).toHaveCount(185);
await expect(list.getByRole("button")).toHaveCount(187);
});

test("a catalog schema can be selected before loading a file and preserves that file on selection", async ({
Expand Down
2 changes: 1 addition & 1 deletion apps/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
},
"peerDependencies": {
"monaco-editor": "^0.57.0",
"vue": "^3.5.44"
"vue": "^3.5.45"
}
}
4 changes: 2 additions & 2 deletions benchmarks/CStructSharp.Benchmarks/DevelopmentEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static Job Apply(Job job, string artifactsPath)
if (requested == "auto")
{
var cpus = new List<int>();
for (int cpu = 0; cpu < (IntPtr.Size * 8) - 1; cpu++)
for (int cpu = 0; cpu < (nint.Size * 8) - 1; cpu++)
{
if ((allowed & (1UL << cpu)) != 0)
{
Expand All @@ -56,7 +56,7 @@ public static Job Apply(Job job, string artifactsPath)
selectedCpu = cpus[cpus.Count / 2];
}
else if (int.TryParse(requested, NumberStyles.None, CultureInfo.InvariantCulture, out int cpu) &&
cpu >= 0 && cpu < (IntPtr.Size * 8) - 1 && (allowed & (1UL << cpu)) != 0)
cpu >= 0 && cpu < (nint.Size * 8) - 1 && (allowed & (1UL << cpu)) != 0)
{
selectedCpu = cpu;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
</PackageReference>
<PackageReference Include="FlatSharp.Runtime" Version="7.9.0" />
<PackageReference Include="KaitaiStruct.Runtime.CSharp" Version="0.11.0" />
<PackageReference Include="MemoryPack" Version="1.21.4" />
<PackageReference Include="MemoryPack" Version="1.22.0" />
<PackageReference Include="MessagePack" Version="3.1.12" />
<PackageReference Include="protobuf-net" Version="3.4.30" />
<PackageReference Include="protobuf-net" Version="3.4.40" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading