Repository navigation
Add opt-in mono AWC compaction and loading geometry inspection - #304
Open
ThomasTrovon wants to merge 1 commit into
Open
ThomasTrovon wants to merge 1 commit into
ThomasTrovon wants to merge 1 commit into
Conversation
Estende build_awc_bytes com compact_streams sem alterar o comportamento padrão e rejeita o uso desse modo em bancos multicanal. Inclui inspeção de spans físicos com alinhamento e orçamento explícitos e compactação de chunks opacos sem recodificar áudio. Orçamentos desconhecidos não são aprovados automaticamente. Documenta evidências, limites e responsabilidade do consumidor; adiciona fixtures sintéticas para preservação, idempotência, endianness, limites de orçamento e tabelas inválidas. Validação na base oficial: 112 testes AWC aprovados e 5 testes de integração não selecionados.
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.
Summary
This adds opt-in mono AWC compaction and a loading-geometry inspector. It does not change the default writer or impose a universal buffer limit.
build_awc_bytes(awc, compact_streams=True)keeps each mono stream's chunks together while preserving logical table order and payloads. Multichannel banks are rejected by this option.inspect_loading_geometry(header, file_size, alignment=..., budget_bytes=...)reports stream spans and the explicitaligned_header + stream_spanmodel. The caller must qualify the alignment, capacity and loading model. Missing budgets remain unknown; multichannel banks do not receive mono-budget verdicts.compact_mono_payloads(data)relocates opaque mono chunks without decoding or recoding their contents. It checks table bounds but does not certify codec validity.Why
During investigation of a modified GTA V Enhanced dialogue bank, we needed to distinguish payload size from the physical span a loader reads. A compact bank plus selective recoding of two oversized entries passed the reported in-game dialogue test without stuttering or crashing.
Importantly, the default FiveFury writer already reproduces that successful artifact for this bank's encrypted mono layout. This is not evidence that the default FiveFury writer caused the crash. The new explicit option covers other mono layouts, while the inspector lets consumers validate the final artifact, including after incremental replacement.
The observed budget is not a universal AWC limit. Game-specific allocation policies and automatic recoding are intentionally outside this PR. No game audio, binaries, dumps or newly extracted keys are included.
Validation
b3e5c3b.python -m pytest tests/audio/awc -q: 112 passed, 5 integration tests deselected on Windows/Python 3.12.Detailed evidence, limitations and Portuguese documentation are in
AWC_LOADING_GEOMETRY.md. The manual game result qualifies the reported dialogue only, not every AWC bank or game version.