Skip to content

BCPack tests: the reference-chunk test uses the shipped tables - #316

Closed
SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-own-next21
Closed

SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-own-next21

Conversation

@SkippySteve

Copy link
Copy Markdown

The BCPack tables ship in the tree (bcpack-tables.bin, read by Tables::builtin), but the opt-in reference_chunks test still demanded VICTORY_BCPACK_TABLES and panicked with VICTORY_BCPACK_TABLES when it was unset. Anyone with reference chunks had to point it at a copy of a file that already sits beside the code.

Now:

  • VICTORY_BCPACK_CASES is the only required variable; the test uses Tables::builtin() by default.
  • VICTORY_BCPACK_TABLES still works as an override for checking a different table file.
  • The #[ignore] reason says what is actually missing (reference chunks outside the repository).

Test-only change in crates/victory-formats/src/bcpack.rs; no decoder code touched.

Testing (Linux)

  • cargo test -p victory-formats: 20 passed, 3 ignored
  • cargo clippy -p victory-formats --all-targets -- -D warnings: clean
  • cargo xtask policy: ok
  • Ran the ignored test both ways against synthetic chunks made by decoding random input with the built-in tables (kept in a scratch directory outside the repo, not committed):
    • VICTORY_BCPACK_CASES=<dir> cargo test -p victory-formats reference_chunks -- --ignored: passes (it panicked on main)
    • the same plus VICTORY_BCPACK_TABLES=crates/victory-formats/src/bcpack-tables.bin: passes

The format's tables now ship in-tree (Tables::builtin), but the ignored
reference_chunks test still panicked unless VICTORY_BCPACK_TABLES named a
table file. It now uses the built-in tables by default; the variable stays
as an override for comparing another table file. Only VICTORY_BCPACK_CASES
is required.
@SkippySteve

Copy link
Copy Markdown
Author

Folded into #315 to keep the PR count down. The commit is unchanged there.

geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 27, 2026
…dows accurately

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BastienRodz added a commit to BastienRodz/VIctory that referenced this pull request Nov 27, 2026
…ND_CHECKS=0 for the old walk)

The crash reporter and the VICTORY_STACKS dumps walk stacks with
RtlVirtualUnwind, and a bad RIP, RSP or frame register makes it read
unmapped memory, or trip a guard page, inside the handler or while
another thread is suspended. With VICTORY_UNWIND_CHECKS on (the default;
unset or empty keeps it on, only "0" turns it off), each step first
checks that RIP is in executable image memory, that the function entry
and unwind records are readable and in that image, that the stack span
they describe is readable, unguarded and inside the thread's stack, that
the PC is not on an epilogue instruction, and that RSP grows. A step it
cannot bound ends the walk. The leaf rule (return address at RSP) is
kept for the first frame only, also in our own VirtualAlloc'd stubs.
The switch is read once, before title code runs and before a thread is
suspended, so neither path takes the environment's lock.

Beyond the original: a chained record's pushes and allocations add to
the bounded span instead of ending the walk, and version 2 epilog codes
are skipped instead of rejected.

Tests: unwind record bounds (allocations, saves, machine frames, chained
and version 2 records, malformed ones), a PC outside an image, the leaf
rule only at the first frame, reserved and guard-page stacks (the guard
stays armed), a corrupt frame register, the switch, and checked and
unchecked walks agreeing on sound stacks (this thread and a suspended one).

Ported from Belobug's VIctory fork (GPL-3.0), PR Marvisak#343 (acbeb30, merged as
d6f95b2). Its PR Marvisak#316 (profiling windows) is not ported: it patches the
sampling profiler, which this tree does not have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
101Leafy pushed a commit to 101Leafy/victory-leafy that referenced this pull request Nov 27, 2026
…s the title's 21 bits (upstream AvatarManz Marvisak#316 by illuminatedfellow)

Page numbers only ever grew, and the title keeps them as 21-bit
`number >> 4`: past ~124 GiB of allocations over a run, a number came
back truncated, unknown to us or aliasing a live page. Numbers are still
given in order while they fit; then the lowest run of freed ones is used,
and an allocation with no such run fails (count 0) instead of handing out
a number the title cannot keep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant