cli: Add RESOURCE_BUCKET_INFO to fossilize-list tag_names - #311
Merged
HansKristian-Work merged 1 commit intoAug 5, 2026
Merged
Conversation
PR ValveSoftware#308 (bucket-json-system, merged via 0ae323c) added RESOURCE_BUCKET_INFO = 10 to the ResourceTag enum but did not extend cli/fossilize_list.cpp's tag_names[] array. As a result: - fossilize-list --help listed 0..9 only, hiding tag 10. - fossilize-list --tag 10 (RESOURCE_COUNT=11, so the guard tag_uint >= RESOURCE_COUNT accepts it) failed with a generic 'Failed to get hashes' log instead of listing tag 10. - fossilize-list --connectivity on a .foz containing RESOURCE_BUCKET_INFO entries hit an out-of-bounds read at tag_names[par.first] when par.first == 10. Fix by appending 'bucketInfo' to tag_names[] and adding a static_assert that sizeof(tag_names)/sizeof(tag_names[0]) == RESOURCE_COUNT. The static_assert catches the same class of drift that e4ec0c1 (2025-11-10) fixed for computePipeline, so this regression cannot recur silently. This complements PR ValveSoftware#308 without touching database storage, the replayer, or PR ValveSoftware#310 (roundtrip-checker, still Draft). Refs: ValveSoftware#308
Collaborator
|
tl;dr. This really should have been a two-line PR description. |
HansKristian-Work
marked this pull request as ready for review
August 5, 2026 10:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cli: Add RESOURCE_BUCKET_INFO to fossilize-list tag_names
Problem
PR #308 (bucket-json-system, merged via
0ae323c) introducedRESOURCE_BUCKET_INFO = 10to theResourceTagenum infossilize_types.hppso the bucket manifest can be stored as aseparate DB entry alongside the
RESOURCE_*pipeline tags.cli/fossilize_list.cppwas not updated to match. Thetag_names[]array still enumerates indices 0..9 only, leavingthree concrete failures:
fossilize-list --helplists tags 0..9, silently hiding tag 10.Users with
.fozfiles that containRESOURCE_BUCKET_INFOentries (any application that ran with the bucket layer
enabled, e.g. Steam on Palworld) cannot discover the tag from
the help output.
fossilize-list --tag 10is accepted by the guardtag_uint >= RESOURCE_COUNT(sinceRESOURCE_COUNT = 11),but then fails with a generic
"Failed to get hashes."log linethat doesn't help the user understand the tag is real but
unlisted.
fossilize-list --connectivityagainst a.fozthat containsRESOURCE_BUCKET_INFOentries performs an out-of-bounds arrayread at
tag_names[par.first]whenpar.first == 10. Thebehavior is undefined; in practice it has caused garbage pointer
dereferences during palworld/Vulkan cache inspection.
Solution
Two surgical changes in
cli/fossilize_list.cpp:"bucketInfo"totag_names[]so the array hasexactly
RESOURCE_COUNTentries.static_assertthatsizeof(tag_names) / sizeof(tag_names[0]) == RESOURCE_COUNTwith a message pointing future contributors to the source of
truth (
fossilize_types.hpp).Both
print_help()(which iteratesi < num_tags) and theruntime
tag_names[par.first]lookup now resolve tag 10correctly. The static_assert closes the same class of drift that
e4ec0c1("Fix broken tag names lut in fossilize-list.",2025-11-10) fixed for
computePipeline, so this regressioncannot recur silently.
Scope Boundary
This PR does not modify:
fossilize_db.{hpp,cpp}) — the39004ffbucket-info entry is read as-is.
cli/fossilize_replay.cpp) —f0270fealreadylogs
Replaying for bucket: ...upstream.layer/instance.cpp) — bucket info is setby
libVkLayer_steam_fossilize.soat recording time.#310(roundtrip-checker, Draft) — orthogonal concernfocused on Mesa CI driver invariance; this fix is a
pre-requisite for inspecting any
.fozproduced by thebucket layer.
Validation
References
RESOURCE_BUCKET_INFO = 10andRESOURCE_COUNT = 11.e4ec0c1— "Fix broken tag names lut in fossilize-list."(Hans-Kristian Arntzen, 2025-11-10): same pattern of fix for
computePipeline; this PR extends the same safeguard.e2169ee— "fossilize-list: List all tags in --help."(Hans-Kristian Arntzen): made the help iteration
num_tags-driven, so adding one entry to the arrayautomatically exposes the new tag in
--help.bdaff23— "Add log connectivity parameter to fossilize-list."(Add log connectivity parameter to fossilize-list #284): introduced the
tag_names[par.first]lookup thatthis PR now makes safe for tag 10.