Skip to content

Fix the regressions of feat/storage-layer against main before the #355 pull request #449

Open

Description

@JasonXuDeveloper

The runner A/B of feat/storage-layer against the previous main (run 44979508452) finds cases that are slower than main beyond the noise floor. This blocks #355's pull request into main.

Setup. Head is c6eff3b. Base is bcc00f8: main 9540e0b with LuminPack 2.0.0-rc.2, so that head's benchmark project builds; Nino's code is main's. The whole Nino suite, 3 rounds.

Floors (base against base) are clean:

CPU Geomean Largest
Neoverse-N2 0.991
Xeon 1.009 1.22 (bimodal Scattered)
EPYC 7763 0.998 1.20
EPYC 9V74 0.995–1.002 1.33

Regressions

Group Cases head ÷ base
(a) small string collections inside objects SimpleClass, TolerantClass, Players, Articles, NullableObjects, ExternalClasses, and WorkloadTest's ProfileCache, LogBatch, EventStream and MediaContent serialize 1.3–2.5 on every x64 runner; N2 1.15–1.57
(b) HashSet<int?> read CollectionsTest.NinoDeserializeNullableHashSetInts 2.2–2.6 on all CPUs
(c) FixedStruct read FixedSizeTest.NinoDeserializeFixedStruct Xeon 2.6–3.0, EPYC 9V74 1.4–1.85 (AVX-512 machines only)
(d) NullableStruct read (NinoNullable) NullableTest.NinoNullableDeserializeNullableStruct EPYC 7763 only (AVX2, no AVX-512): 6.2–12.4
(e) Scattered write ScatteredTest.NinoSerializeScatteredItems EPYC 1.6–2.3

Bisect so far (local Xeon, alternating processes)

Groups (a) and (b) reproduce locally: SimpleClass 1.37, Players 2.0, MediaContent 1.45, NullableHashSetInts 2.3.

The cause is a fixed setup cost per run on entering the string and pair kernels. A top-level Dictionary<int, string> of one entry costs +30 ns (1.8×), while 1,000 elements are on par or faster.

Done means

  • (a) and (b): the shared kernel's entry is cheap at every length (no separate small-collection path), shown in listings against main and in local numbers at 1, 3, 32 and 1,000 elements.
  • (c) and (d) reproduced on matching hardware settings (DOTNET_EnableAVX512F=0 for the 7763), with the cause found and fixed.
  • (e) checked.
  • A runner A/B of the fixed branch against main shows no case slower beyond the floor.

Part of #355.


Generated by Claude Code

Activity

  1. added
    kind: perf
    area: core
    kind: bug
    on Nov 22, 2026
  2. added this to the v4.0.0 milestone on Nov 22, 2026
  3. JasonXuDeveloper commented on Nov 22, 2026

    @JasonXuDeveloper
    OwnerAuthor

    Per-CPU summary of run 44979508452 from the 17 jobs finished so far (head min ÷ base min over 3 rounds; "> 1.05" counts the cases above 1.05):

    CPU Floor (base vs base): geomean, cases > 1.05 Head vs base: geomean, cases > 1.05
    Neoverse-N2 0.991, 8 0.993, 45
    Intel Xeon 0.997 / 1.009, 6 / 16 0.999 / 1.000, 51 / 51
    EPYC 9V74 0.995 / 1.002, 9 / 12 0.988 / 1.002 / 1.002, 48 / 51 / 51
    EPYC 7763 0.995 / 0.998, 10 / 10 1.010 / 1.016 / 1.020, 68 / 59 / 69

    The geomeans are on par. The regressions are the 40 to 60 cases above 1.05 that the floor lacks, listed in this issue's groups; each group repeats across jobs on the same CPU.

    Progress on the fix (WIP on claude/storage-fix, local, alternating, ÷ main):

    Case Before Now
    Players serialize 2.0 1.18
    SimpleClass serialize 1.35 1.12
    TolerantClass serialize 1.43 1.09
    MediaContent serialize 1.45 1.05
    Top-level Dictionary<int, string>, 1 entry 1.8 0.83
    List<string>, 3 elements 1.3 0.71
    HashSet<int?> read, 1,000 elements 2.21 0.97

    What changed:

    • The set read boxed every non-null int? in HashTables.Hash.
    • The string run kernels took NinoRun and Writer by value, so their copies hit store-forwarding stalls.

    A whole-codebase boxing sweep with allocation guard tests now runs on claude/storage-nobox.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corekind: bugkind: perf

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions