freakyzoidberg opened a new pull request, #187: URL: https://github.com/apache/datasketches-go/pull/187
## What - **`fix(theta)`:** an empty compact theta sketch now serializes with zero seed hash bytes (6, 7), as C++ and Java do. `theta_n0_go.sk` is regenerated and is now byte-identical to the C++ and Java images. - A-not-B skips the seed hash check for an empty B, as C++ does, because an empty sketch decoded from such an image reports a zero seed hash. Empty images from C++ and Java already carry a zero seed hash. - **`test`:** the theta and tuple snapshot generators use `assertUpdate` instead of `assert.NoError` for updates, so `make generate-go-snapshots` passes again. Since #181 it has failed, because updates that theta screens out return `ErrHashExceedsTheta`. The generated snapshots are unchanged. Addresses #186. ## Why the generator change is here The TCK regenerates the Go snapshots with `make generate-go-snapshots`. It currently fails on `main`, so without this change the TCK could not pick up the fix. ## Verification - `go test ./...`, gofmt, go vet and golangci-lint pass. - New tests check that the empty image is exactly `01 03 03 00 00 1e 00 00` and decodes with any seed, and cover A-not-B with a decoded empty B. Each fails without its change. - `make generate-go-snapshots` passes. Among deterministic snapshots, only `theta_n0_go.sk` changes. - datasketches-java `ThetaSketchCrossLanguageTest`, run with the TCK C++ snapshots, current Java `main` and the Go snapshots from this branch: Go vs C++ passes for every size, and the n=0 failure from #186 (`element [6]; expected value is <0> but was <-52>`) is gone. Go vs Java and C++ vs Java still fail at n=1, because Java `main` sets the single-item flag on that image. That difference is on the Java side. ## Follow-up For the Java cross-language tests to see this, the TCK Go snapshots need regenerating from `main` after this merges (`mise run tck -- snapshots update go main`), and datasketches-java's `TCK_REVISION` then needs bumping. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
