Title profile: refuse empty roles the engine reads, cap table reads, install whole #589
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/589"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from readmet3xt-lab/foxhound. Originally posted by oxybes on 2026-12-04T08:48:35Z.
Three problems a title profile can hand a run silently. Each is fixed here with a test; no behaviour changes for a profile that names every role it needs.
1. An empty role is silent
A profile that names no shader for a role the engine reads at run time (
bake,bake_geometry,face_shapes,interface_composite,scene_input,leave_out,rt_resolve,ambient.*,water.leave_out) simply makesplays()return false everywhere. Nothing is logged, androles=<n>counts declared entries, not the ones that matter.We lost a character's blend-shape pass for a whole scene this way:
roles=13/22was printed, the pipeline was never waited for at its first use, the once-only dispatch was dropped and the face stayed missing for the session. It took reading the pipeline logs to find it.victory title-profile installnow prints one line per empty load-bearing role, with what it costs, and refuses unless--allow-empty-rolesis passed.lds_unboundedandprobe_ray_activationare reported but never refuse: their absence keeps the conservative behaviour (shared-memory bounds checks; the activation pass running), and the first one's program hashes are private to a profile we do not have.The status/run line reports
roles=<n>/<N>withNfrom the same list, and a run names the empty ones once atinfo.tables=,file=and the field order are unchanged, so the launcher and scripts keep parsing it.2. Install is not atomic
Table files were written into the live install folder before
profile.toml, so an interrupted install (a full disk, a locked file, a refused table) left the previous profile next to replaced table bytes; the next start refused a table and the feature it needed was off.Install now validates everything, stages into
<target>.new-<pid>on the same volume, re-hashes each staged table (the hash used to be taken before the copy, so a file swapped in between would install unchecked), then swaps by rename:<target>-><target>.old-<pid>, staged -><target>, delete the old. A failure before the swap removes the staged folder and leaves the previous install whole; a failed final rename puts the old folder back (tried twice, error names both paths).<name>.new-<pid>and<name>.old-<pid>are excluded from the profile search, and leftovers of other pids are removed at the next install.3. Table reads have no cap
A multi-gigabyte
bcpack*.binbeside the executable, or an oversizedpipelinestable, was read whole at start or during warm, twice.Table lookups now check metadata first (a plain file, at most 256 MiB; the bcpack table exactly
TABLES_SIZE), hash with a streamed reader, and name the reason when a candidate is passed over.VICTORY_PIPELINE_LISTandSeed::opencheck a list against the same cap.Also in this PR
name_lenof 3 is refused. Three bytes is exactly theCS_prefix and the role search hashesname_lenbytes from that position, soname_len = 3with the FNV ofCS_(0b424019aa0d5a04) matched every compute program. The empty name's FNV stays refused.VICTORY_PROFILE_ANY_EXEaccepts0,off,false,noin any case, not just the literal0.[[place]]offsets are bounds-checked withchecked_addagainst the image, and the settings places (root,slot,method,offset) are validated before pointer arithmetic, so a garbled profile cannot read out of bounds even in a diagnostics build.Errorinstead of panicking on a short file.Testing
cargo test -p victory-profile: 37 tests, including the role lists asserted by literal name and for disjointness, a report-only role installing, an empty load-bearing role refusing, a failedfillleaving the previous install whole, and over-cap and wrong-size tables refused before they are read.cargo test -p victory-gpu --lib: 649 (the pipelines list cap).cargo test -p victory-formats: 47 (a short table is an error, not a panic).cargo test -p victory-loader frame_rate::: a garbled settings place is not read.face_shapesremoved: refuses, exit 1, and the installed profile is byte-identical afterwards.Compatibility
title-profile installnow exits 1 on a refusal; it used to return 0 for most of them, which made "installed" and "refused" indistinguishable to a script.Report::missing_tablesgains the file and a reason (tables=missing:pipelines(over-cap)); the field still starts withtables=.Seed::openreturnsio::Result; its only caller in the tree iswarm.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.