Skip to content

Census: report directory traversal failures - #115

Merged
Marvisak merged 1 commit into
Marvisak:mainfrom
ZekkJJ:codex/census-scan-errors
Nov 25, 2026
Merged

Marvisak merged 1 commit into
Marvisak:mainfrom
ZekkJJ:codex/census-scan-errors

Conversation

@ZekkJJ

@ZekkJJ ZekkJJ commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

What

victory census discarded errors from the directory walker. A missing input path could exit successfully and report zero images and zero unreadable files.

Return a nonzero exit status with the path when a scan root fails. Report traversal errors within a readable root alongside skipped inputs while continuing to scan its other entries.

Tested

  • Windows 11 x64, Rust 1.98.1. The missing-path regression failed before the fix and passed after it. A valid input with no PE images still succeeds.
  • cargo test --locked --workspace -- --nocapture reported 247 passed, 0 failed, and 3 ignored. Four shader tests returned early because their compiler prerequisites were unavailable.
  • cargo clippy --locked -p victory --all-targets, rustfmt on both changed files, and cargo xtask policy passed.

AI assistance: Codex wrote the patch and tests and ran the checks. No game files were used.

Fail when a requested scan root cannot be opened. Report traversal errors below a readable root alongside the other skipped inputs.
@noviw-rblx

Copy link
Copy Markdown

checked: #115 | with: cargo test -p victory --test census | on: Windows 10, Rust 1.98.1, head b1bdd89, CPU only | result: 2 passed (census_fails_when_a_requested_path_is_missing, census_accepts_a_valid_path_with_no_pe_images). No game data required.

@ZekkJJ

ZekkJJ commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

LGTM

@DaviTostes

Copy link
Copy Markdown

Tested b1bdd89: pass.

  • Tested the Windows build under Wine 11.22 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), cargo xwin test ... -p victory.
  • tests/census.rs: 2 passed. The app's own test (loader_lock_is_reentrant_and_exclusive) also passes.

No game data used.

edsuuu referenced this pull request in edsuuu/VI-BR-PORT Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ghost ghost mentioned this pull request Nov 24, 2026
@KevinPratap

Copy link
Copy Markdown
Contributor

These census tests fail once #535 (asset-policy check in default_paths) is merged too, because they census the crate's own Cargo.toml, inside the source tree. Fix against this branch, verified alone and with #535: ZekkJJ#1. AI-assisted.

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested b1bdd89 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (247 passed, 0 failed; older base), including the two new tests/census.rs integration tests.

walkdir reports a missing or unreadable root as an error at depth 0. Failing the command there, with the path in the context, and recording deeper errors alongside unreadable images matches what a user would expect. Before, a typo in the path printed a clean "0 images scanned". The tests run the built victory binary on the crate's own Cargo.toml and a missing sibling, so they use no title data.

No issues found.

AI-assisted (Claude Code).

mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
…ilures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot pushed a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
Merges Marvisak#115 Marvisak#151 Marvisak#238 Marvisak#353 Marvisak#378 Marvisak#476 Marvisak#482 Marvisak#535 Marvisak#649 Marvisak#664 Marvisak#1177 onto main
(ffe310e), each head unchanged, no conflicts.

One change of mine: Marvisak#378 turns the duplicate check in translate.rs into a
nested `if !seen.insert(..) { if !list { .. } }`, which
clippy::collapsible_if rejects under -D warnings; it is now one
`if !seen.insert(..) && !list` (clippy --fix, same behaviour).

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(354 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@Marvisak
Marvisak merged commit b5ac27f into Marvisak:main Nov 25, 2026
LukeFarch pushed a commit to LukeFarch/VIctory that referenced this pull request Nov 25, 2026
The title shows one physical page at several addresses. A copy taken
through one of them was guarded at that address only, so a write through
another left the copy as it was for the rest of the run. On one machine
the first room's walls and a face's shading came back in two runs out of
two; the walls also came back by themselves in some earlier runs, so this
is not proof.

Code of victory-fork Marvisak#115 by Spexivus (the index of the views of each
page, the guard over all of them), with joroyt's correction of it (another
view is made read-only, not noted clean) and the set of aliased blocks of
VIctory Marvisak#1122 by tightfall. Added here: a page of more than 64 views is
guarded one view at a time, a switch (VICTORY_VIEW_GUARD=0), counts in the
diagnostics log, and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Ported onto this fork's own-write settling (own_write_begin and
own_write_end open and guard through the same paths).

Claude-Session: https://claude.ai/code/session_01DnmJgv1UMusjz7uG9bKMA7
Vaximous pushed a commit to Vaximous/VIctory that referenced this pull request Nov 25, 2026
…rites counted; levels on demand (off); warm-up; card memory numbers

Memory sync:
- The guard over every view of a physical page (code by myokex, victory-amd
  c6dc4d8, after pull request Marvisak#115 by Spexivus, its correction by joroyt and
  a part of VIctory Marvisak#1122 by tightfall): the title shows one page at several
  addresses and a copy was guarded at one only. 0.8 to 1.0 million writes
  through another view in a five-minute run on the test machine.
  VICTORY_VIEW_GUARD=0 turns it off.
- Kernel reads into title memory are read beside and copied in (Joshua Odom,
  10ea38e).
- Writes of the storage layer into physical pages are counted where the
  title has the pages mapped and can open the guards there
  (VICTORY_PAGE_WRITES, off: counted only). Failed page-destination reads
  are retried.

Card memory:
- Levels on demand, off unless VICTORY_LEVELS_ON_DEMAND=1: a texture the
  title fills takes card memory for the levels the title holds; held levels
  get memory only while the card has room and are asked for again. Its test
  runs on the software adapter; not run on a card yet.
- Refused texture slots are held back so a pass reaches the slots behind
  them; room can be kept for card copies of title buffers (off).

Tools: translate --warm all; the shader cache is keyed on the translator's
source; counters for copy-back races, page writes and the copies the
texture sweep never lets go; a walls trace.

Game runs of these changes on an RTX 4070: five five-minute runs without a
device loss or a failed request. This merged tree was built; its test
suites were run on the tree the changes come from (gpu 129, hle 97).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

6 participants