Go packet defaults for strings, bytes and flags - #622
Merged
Merged
Conversation
Apply fresh construction on every decoder selection, retain managed storage, and cover all nine languages with independent bit oracles and semantic negative controls. Bump WireLaw to 2 and repin generated output and metadata. Full integration gate remains pending. Co-Authored-By: GPT-6
Merge 6be68a7, resolving generated artifacts through the compiler. make update-goldens including go test ./... passes on the combined tree; full cross-language integration remains pending. Co-Authored-By: GPT-6
Co-Authored-By: GPT-6
Co-Authored-By: GPT-6
Co-Authored-By: GPT-6
Co-Authored-By: GPT-6
Co-Authored-By: GPT-6
Co-Authored-By: GPT-6
Keep the Go support cell and canonical golden updater aligned with the feature. Co-Authored-By: GPT-6
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.
Go packet structs now apply declared
string(N),bytes(N)and flags defaults through their existingNew<Type>constructors. Strings and byte buffers receive exact literal bytes, used lengths and zeroed unused capacity; flags retain the full unsigned 64-bit mask. Selected union payloads use these constructors under the shared rule landed in #616, including repeated selection.This PR ports Go for #589. Packet defaults initialize storage and fields retain their ordinary packet encodings. The compiler uses the existing
TableClosurewalk to keep the named refusal for defaults reachable from a table, including through arrays, union arms, pointers and maps. An unrelated table does not block supported packet defaults. The specification, comparison page and Go packet roadmap cell state this split.The first port adds a shared packet oracle for the remaining languages: seven C++ byte/bit goldens, with a defaultless twin explicitly initialized to the same values. The Go verifier checks independent constructor expectations and decodes the C++ bytes. Coverage includes exact-capacity UTF-8, literal backslash bytes, empty defaults, partial literals with zero suffixes, bit 63 and all 64 flag bits, nested and array construction, counted backing capacity, received short/empty prefixes, repeated union selection and the existing false-branch zero rule.
The Go negative control removes only the constructor's byte-array assignment. The modified compiler and generated verifier must build successfully, then execution must fail on the exact
FAILED: packet-default constructor bytesassertion. Normal tests compare pins; the existingupdate-goldenscommand includes the new oracle's explicit pin update.Validation on main
e552e64b, including landed #616 at5c9688e6:go test ./...passes, including packet-carrier and table-closure refusal tests.make -j1 test-gopasses, including the C++ oracle, Go defaults verifier, constructor negative control, existing packet suites and table fuzz/race checks.make -j1 update-goldenspasses, executes the new oracle's explicit update, and leaves all seven new byte/bit pins identical. Existing pinned data remain unchanged.49583c713d4cca9b53b17ebd15986122cac50b70, including generated-current, Go tests, lint, Windows/MSVC, big-endian and all nine conformance jobs. Full branch certification is still underway on that head.No packet codec law or C/C++ packet emitter changes. The remaining seven packet ports and Go table defaults are separate work; this PR does not close #589.