Documentation
¶
Index ¶
- Constants
- func CompiledGoAMD64Level() string
- func DREDModelSourcesStamp() string
- func DREDSIMDBuildEnv() ([]string, error)
- func DREDSIMDBuildIsCurrent(buildDir string) bool
- func DefaultSearchRoots() []string
- func EnsureLibopus(version string, roots []string) bool
- func EnsureLibopusCustom(version string, roots []string) bool
- func EnsureLibopusCustomFixedQEXTSIMD(version string, roots []string) bool
- func EnsureLibopusCustomFixedQEXTScalar(version string, roots []string) bool
- func EnsureLibopusCustomFixedSIMD(version string, roots []string) bool
- func EnsureLibopusCustomFixedScalar(version string, roots []string) bool
- func EnsureLibopusCustomQEXTSIMD(version string, roots []string) bool
- func EnsureLibopusCustomQEXTScalar(version string, roots []string) bool
- func EnsureLibopusCustomScalar(version string, roots []string) bool
- func EnsureLibopusDREDQEXTSIMD(version string, roots []string) bool
- func EnsureLibopusDREDQEXTScalar(version string, roots []string) bool
- func EnsureLibopusFixedQEXTSIMD(version string, roots []string) bool
- func EnsureLibopusFixedQEXTScalar(version string, roots []string) bool
- func EnsureLibopusFixedSIMD(version string, roots []string) bool
- func EnsureLibopusFixedScalar(version string, roots []string) bool
- func EnsureLibopusQEXT(version string, roots []string) bool
- func EnsureLibopusQEXTSIMD(version string, roots []string) bool
- func EnsureLibopusQEXTScalar(version string, roots []string) bool
- func EnsureLibopusSIMD(version string, roots []string) bool
- func EnsureLibopusScalar(version string, roots []string) bool
- func FindCCompiler() (string, error)
- func FindOpusCompare(version string, roots []string) (string, error)
- func FindOpusDemo(version string, roots []string) (string, error)
- func FindOrEnsureDefaultOpusDemo(version string, roots []string) (string, error)
- func FindOrEnsureOpusCompare(version string, roots []string) (string, error)
- func FindOrEnsureOpusDemo(version string, roots []string) (string, error)
- func FindOrEnsureOpusDemoForVariant(version string, roots []string, variant LibopusReferenceVariant) (string, error)
- func FindOrEnsureQEXTOpusDemo(version string, roots []string) (string, error)
- func FindQEXTOpusDemo(version string, roots []string) (string, bool)
- func LibopusAMD64TargetCFlags() ([]string, error)
- func LibopusReferenceSourceSuffix(variant LibopusReferenceVariant) (string, error)
- func OSCEScalarDNNBuildEnv() ([]string, error)
- func OSCEScalarDNNBuildIsCurrent(buildDir string) bool
- func ResetDREDSIMDBuildIfStale(buildDir string) error
- func ResetOSCEScalarDNNBuildIfStale(buildDir string) error
- func ResetScalarDNNBuildIfStale(buildDir string) error
- func ResolveLibopusAMD64Target() (string, error)
- func ScalarDNNBuildEnv() ([]string, error)
- func ScalarDNNBuildIsCurrent(buildDir string) bool
- func ValidateDREDModelSources(sourceDir string) error
- func ValidateLibopusInstructionConfig(config string, variant LibopusReferenceVariant, goarch string) error
- func ValidateLibopusReferenceArchive(archivePath string, variant LibopusReferenceVariant, version string) error
- func ValidateLibopusReferenceBuild(refDir string, variant LibopusReferenceVariant, version string) error
- func ValidateLibopusReferenceToolOverride(path, tool string, variant LibopusReferenceVariant, version string) error
- func WriteDREDSIMDBuildStamp(buildDir string) error
- func WriteOSCEScalarDNNBuildStamp(buildDir string) error
- func WriteScalarDNNBuildStamp(buildDir string) error
- type LibopusBuildProvenance
- type LibopusReferenceConfigError
- type LibopusReferenceVariant
- func ResolveLibopusCustomFixedQEXTReferenceVariant() (LibopusReferenceVariant, error)
- func ResolveLibopusCustomFixedReferenceVariant() (LibopusReferenceVariant, error)
- func ResolveLibopusCustomQEXTReferenceVariant() (LibopusReferenceVariant, error)
- func ResolveLibopusDREDQEXTReferenceVariant() (LibopusReferenceVariant, error)
- func ResolveLibopusFixedQEXTReferenceVariant() (LibopusReferenceVariant, error)
- func ResolveLibopusFixedReferenceVariant() (LibopusReferenceVariant, error)
- func ResolveLibopusQEXTReferenceVariant() (LibopusReferenceVariant, error)
- func ResolveLibopusReferenceVariant() (LibopusReferenceVariant, error)
Constants ¶
const ( // DefaultVersion is the pinned libopus reference used by fixture tooling. DefaultVersion = "1.6.1" // dnn/vec.h selects its vector implementation from compiler macros even // when libopus RTCD and intrinsics are disabled. Clear those macros so the // scalar DRED reference uses the generic DNN path on every architecture. ScalarDNNBuildCFLAGS = LibopusScalarCFLAGS + " -DDISABLE_NEON -U__ARM_NEON__ -U__ARM_NEON -U__AVX__ -U__AVX2__ -U__FMA__ -U__SSE__ -U__SSE2__ -U__SSE3__ -U__SSSE3__ -U__SSE4_1__ -U__SSE4_2__" // The SIMD DRED reference uses the native libopus instruction selection and // optimization level paired with GOEXPERIMENT=simd. DREDSIMDBuildCFLAGS = LibopusBaseCFLAGS // OSCEScalarDNNBuildCFLAGS keeps OSCE BWE/LACE reference helpers on the // generic DNN path even on ARM, where dnn/vec.h checks compiler NEON macros // directly. OSCEScalarDNNBuildCFLAGS = "" /* 170-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func CompiledGoAMD64Level ¶ added in v0.2.0
func CompiledGoAMD64Level() string
CompiledGoAMD64Level reports the GOAMD64 level used to compile this binary. It is empty on non-amd64 builds.
func DREDModelSourcesStamp ¶ added in v0.2.0
func DREDModelSourcesStamp() string
DREDModelSourcesStamp identifies the pinned DRED model source contents in a feature build stamp.
func DREDSIMDBuildEnv ¶ added in v0.2.0
DREDSIMDBuildEnv pins the native compiler and flags for the DRED SIMD oracle.
func DREDSIMDBuildIsCurrent ¶ added in v0.2.0
DREDSIMDBuildIsCurrent checks the isolated native-instruction DRED build.
func DefaultSearchRoots ¶
func DefaultSearchRoots() []string
DefaultSearchRoots covers common invocation locations: repository root, package subdirs (e.g. testvectors), and deeper test runs.
func EnsureLibopus ¶
EnsureLibopus invokes tools/ensure_libopus.sh from the first matching root.
func EnsureLibopusCustom ¶
EnsureLibopusCustom invokes tools/ensure_libopus.sh with ENABLE_CUSTOM enabled (libopus configured with --enable-custom-modes, defining CUSTOM_MODES and the Opus Custom API) from the first matching root.
func EnsureLibopusCustomFixedQEXTSIMD ¶ added in v0.2.0
EnsureLibopusCustomFixedQEXTSIMD builds the paired CUSTOM_MODES + FIXED_POINT + QEXT SIMD reference.
func EnsureLibopusCustomFixedQEXTScalar ¶ added in v0.2.0
EnsureLibopusCustomFixedQEXTScalar builds the paired CUSTOM_MODES + FIXED_POINT + QEXT scalar reference.
func EnsureLibopusCustomFixedSIMD ¶ added in v0.2.0
EnsureLibopusCustomFixedSIMD builds the paired CUSTOM_MODES + FIXED_POINT SIMD reference.
func EnsureLibopusCustomFixedScalar ¶ added in v0.2.0
EnsureLibopusCustomFixedScalar builds the paired CUSTOM_MODES + FIXED_POINT scalar reference.
func EnsureLibopusCustomQEXTSIMD ¶ added in v0.2.0
EnsureLibopusCustomQEXTSIMD builds the paired CUSTOM_MODES + QEXT SIMD reference.
func EnsureLibopusCustomQEXTScalar ¶ added in v0.2.0
EnsureLibopusCustomQEXTScalar builds the paired CUSTOM_MODES + QEXT scalar reference.
func EnsureLibopusCustomScalar ¶
EnsureLibopusCustomScalar invokes tools/ensure_libopus.sh with ENABLE_CUSTOM_SCALAR enabled (--enable-custom-modes on the scalar generic-C kernels) from the first matching root with the standard scalar compiler policy.
func EnsureLibopusDREDQEXTSIMD ¶ added in v0.2.0
EnsureLibopusDREDQEXTSIMD builds the combined DRED + QEXT RTCD/intrinsics reference.
func EnsureLibopusDREDQEXTScalar ¶ added in v0.2.0
EnsureLibopusDREDQEXTScalar builds the combined DRED + QEXT generic-C reference.
func EnsureLibopusFixedQEXTSIMD ¶ added in v0.2.0
EnsureLibopusFixedQEXTSIMD builds the FIXED_POINT + ENABLE_QEXT RTCD/intrinsics reference.
func EnsureLibopusFixedQEXTScalar ¶ added in v0.2.0
EnsureLibopusFixedQEXTScalar builds the FIXED_POINT + ENABLE_QEXT generic-C reference.
func EnsureLibopusFixedSIMD ¶ added in v0.2.0
EnsureLibopusFixedSIMD builds the FIXED_POINT RTCD/intrinsics reference.
func EnsureLibopusFixedScalar ¶ added in v0.2.0
EnsureLibopusFixedScalar builds the FIXED_POINT generic-C reference.
func EnsureLibopusQEXT ¶
EnsureLibopusQEXT invokes tools/ensure_libopus.sh with ENABLE_QEXT enabled from the first matching root.
func EnsureLibopusQEXTSIMD ¶ added in v0.2.0
EnsureLibopusQEXTSIMD builds the QEXT-enabled RTCD/intrinsics reference.
func EnsureLibopusQEXTScalar ¶ added in v0.2.0
EnsureLibopusQEXTScalar builds the QEXT-enabled generic-C reference.
func EnsureLibopusSIMD ¶
EnsureLibopusSIMD invokes tools/ensure_libopus.sh with ENABLE_SIMD enabled (libopus configured with its native --enable-rtcd --enable-intrinsics, so config.h DEFINES the platform SIMD macros) from the first matching root. It is paired with Go SIMD builds and direct tests of matching SIMD kernels.
func EnsureLibopusScalar ¶
EnsureLibopusScalar invokes tools/ensure_libopus.sh with ENABLE_SCALAR enabled (generic C with assembly, RTCD, intrinsics, loop vectorization, and SLP vectorization disabled) from the first matching root. FMA contraction stays enabled to match scalar Go arithmetic.
func FindCCompiler ¶
FindCCompiler returns a GCC/Clang-style C compiler suitable for helper builds.
func FindOpusCompare ¶
FindOpusCompare returns a validated opus_compare from the reference tree paired with the current Go build.
func FindOpusDemo ¶
FindOpusDemo returns a validated opus_demo from the reference tree paired with the current Go build.
func FindOrEnsureDefaultOpusDemo ¶ added in v0.2.0
FindOrEnsureDefaultOpusDemo selects the unsuffixed autotools-default tree independently of the current Go instruction lane. It is appropriate only for fixtures whose recorded producer path is tmp_check/opus-<version>/opus_demo.
func FindOrEnsureOpusCompare ¶
FindOrEnsureOpusCompare builds and validates the explicit tree paired with the current Go build before locating opus_compare.
func FindOrEnsureOpusDemo ¶
FindOrEnsureOpusDemo builds and validates the explicit tree paired with the current Go build before locating opus_demo.
func FindOrEnsureOpusDemoForVariant ¶ added in v0.2.0
func FindOrEnsureOpusDemoForVariant(version string, roots []string, variant LibopusReferenceVariant) (string, error)
FindOrEnsureOpusDemoForVariant selects an explicit libopus reference tree without consulting the Go scalar/SIMD lane. Fixture honesty uses this when the fixture records a scalar or SIMD producer.
func FindOrEnsureQEXTOpusDemo ¶
FindOrEnsureQEXTOpusDemo resolves the QEXT-enabled tool paired with the current Go instruction lane and validates its build before returning it.
func FindQEXTOpusDemo ¶
FindQEXTOpusDemo returns the first executable QEXT-enabled opus_demo build found under tmp_check.
func LibopusAMD64TargetCFlags ¶ added in v0.2.0
LibopusAMD64TargetCFlags returns the exact target flags for directly compiled C helpers, or nil when the amd64 target override is unset.
func LibopusReferenceSourceSuffix ¶ added in v0.2.0
func LibopusReferenceSourceSuffix(variant LibopusReferenceVariant) (string, error)
LibopusReferenceSourceSuffix returns the mandatory source-tree suffix for a paired reference. The unsuffixed autotools-default tree is never selected; an AMD64 target opt-in adds its target identity to the default float tree.
func OSCEScalarDNNBuildEnv ¶
OSCEScalarDNNBuildEnv returns a controlled environment for OSCE reference helper builds.
func OSCEScalarDNNBuildIsCurrent ¶
OSCEScalarDNNBuildIsCurrent reports whether buildDir was produced with the current OSCE-enabled scalar-DNN helper contract.
func ResetDREDSIMDBuildIfStale ¶ added in v0.2.0
ResetDREDSIMDBuildIfStale removes only the stale DRED SIMD build directory.
func ResetOSCEScalarDNNBuildIfStale ¶
ResetOSCEScalarDNNBuildIfStale removes buildDir when it was produced before the current OSCE-enabled scalar-DNN helper contract.
func ResetScalarDNNBuildIfStale ¶
ResetScalarDNNBuildIfStale removes buildDir when it was produced before the current scalar-DNN helper contract. This avoids silently reusing x86-vector DNN reference oracles from older local or CI caches.
func ResolveLibopusAMD64Target ¶ added in v0.2.0
ResolveLibopusAMD64Target validates the optional GOAMD64-matched reference target. It returns an empty target when the opt-in is unset.
func ScalarDNNBuildEnv ¶
ScalarDNNBuildEnv returns a controlled environment for libopus helper builds.
func ScalarDNNBuildIsCurrent ¶
ScalarDNNBuildIsCurrent reports whether buildDir was produced with the current scalar-DNN helper contract.
func ValidateDREDModelSources ¶ added in v0.2.0
ValidateDREDModelSources verifies the pinned DRED model source identity in a reference source tree before a feature archive is reused or built.
func ValidateLibopusInstructionConfig ¶ added in v0.2.0
func ValidateLibopusInstructionConfig(config string, variant LibopusReferenceVariant, goarch string) error
ValidateLibopusInstructionConfig checks the complete SIMD/RTCD macro family in a generated config.h against the selected Go instruction lane.
func ValidateLibopusReferenceArchive ¶ added in v0.2.0
func ValidateLibopusReferenceArchive(archivePath string, variant LibopusReferenceVariant, version string) error
ValidateLibopusReferenceArchive validates the provenance stamped beside an archive path. Paired archives live under <source>/.libs/libopus.a.
func ValidateLibopusReferenceBuild ¶ added in v0.2.0
func ValidateLibopusReferenceBuild(refDir string, variant LibopusReferenceVariant, version string) error
ValidateLibopusReferenceBuild verifies the stamp, host/compiler target, generated config, and static archive for a paired reference tree.
func ValidateLibopusReferenceToolOverride ¶ added in v0.2.0
func ValidateLibopusReferenceToolOverride(path, tool string, variant LibopusReferenceVariant, version string) error
ValidateLibopusReferenceToolOverride requires an explicit tool executable to resolve to the requested tool in a validated, explicitly named paired tree. It validates the executable target so a symlink cannot escape into another variant while callers can continue returning the user's original path.
func WriteDREDSIMDBuildStamp ¶ added in v0.2.0
WriteDREDSIMDBuildStamp records the native DRED helper build contract.
func WriteOSCEScalarDNNBuildStamp ¶
WriteOSCEScalarDNNBuildStamp records that buildDir satisfies the current OSCE-enabled scalar-DNN helper contract.
func WriteScalarDNNBuildStamp ¶
WriteScalarDNNBuildStamp records that buildDir satisfies the current scalar-DNN helper contract.
Types ¶
type LibopusBuildProvenance ¶
type LibopusBuildProvenance struct {
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
LibopusVersion string `json:"libopus_version"`
QEXT string `json:"qext"`
HostOS string `json:"host_os"`
HostArch string `json:"host_arch"`
HostBits string `json:"host_bits"`
CC string `json:"cc"`
CCPath string `json:"cc_path"`
CCTarget string `json:"cc_target"`
CCVersion string `json:"cc_version"`
Configure string `json:"configure"`
CFLAGS string `json:"cflags"`
CPPFLAGS string `json:"cppflags"`
LDFLAGS string `json:"ldflags"`
LibopusBuildStampSHA256 string `json:"libopus_build_stamp_sha256"`
}
LibopusBuildProvenance captures the native helper build that produced a generated libopus fixture.
func LibopusBuildProvenanceForTool ¶
func LibopusBuildProvenanceForTool(toolPath string) (LibopusBuildProvenance, bool)
LibopusBuildProvenanceForTool returns provenance for a tool produced by tools/ensure_libopus.sh. The returned digest is over the exact stamp file bytes so fixture metadata changes whenever the validated native helper build changes.
type LibopusReferenceConfigError ¶ added in v0.2.0
type LibopusReferenceConfigError struct {
Err error
}
LibopusReferenceConfigError reports a paired-reference override or build whose declared configuration does not match the requested Go lane.
func (*LibopusReferenceConfigError) Error ¶ added in v0.2.0
func (e *LibopusReferenceConfigError) Error() string
func (*LibopusReferenceConfigError) Unwrap ¶ added in v0.2.0
func (e *LibopusReferenceConfigError) Unwrap() error
type LibopusReferenceVariant ¶ added in v0.2.0
type LibopusReferenceVariant string
LibopusReferenceVariant identifies the native libopus instruction path that matches the current Go build.
const ( // LibopusAMD64TargetEnv selects a separately built amd64 float-core // reference at the requested GOAMD64 level. Empty keeps the established // reference tree selection. LibopusAMD64TargetEnv = "GOPUS_LIBOPUS_AMD64_TARGET" LibopusReferenceScalar LibopusReferenceVariant = "scalar" LibopusReferenceSIMD LibopusReferenceVariant = "simd" LibopusReferenceFixedScalar LibopusReferenceVariant = "fixed-scalar" LibopusReferenceFixedSIMD LibopusReferenceVariant = "fixed-simd" LibopusReferenceFixedQEXTScalar LibopusReferenceVariant = "fixed-qext-scalar" LibopusReferenceFixedQEXTSIMD LibopusReferenceVariant = "fixed-qext-simd" LibopusReferenceQEXTScalar LibopusReferenceVariant = "qext-scalar" LibopusReferenceQEXTSIMD LibopusReferenceVariant = "qext-simd" LibopusReferenceDREDQEXTScalar LibopusReferenceVariant = "dred-qext-scalar" LibopusReferenceDREDQEXTSIMD LibopusReferenceVariant = "dred-qext-simd" LibopusReferenceCustomScalar LibopusReferenceVariant = "custom-scalar" LibopusReferenceCustomSIMD LibopusReferenceVariant = "custom-simd" LibopusReferenceCustomQEXTScalar LibopusReferenceVariant = "custom-qext-scalar" LibopusReferenceCustomQEXTSIMD LibopusReferenceVariant = "custom-qext-simd" LibopusReferenceCustomFixedScalar LibopusReferenceVariant = "custom-fixed-scalar" LibopusReferenceCustomFixedSIMD LibopusReferenceVariant = "custom-fixed-simd" LibopusReferenceCustomFixedQEXTScalar LibopusReferenceVariant = "custom-fixed-qext-scalar" LibopusReferenceCustomFixedQEXTSIMD LibopusReferenceVariant = "custom-fixed-qext-simd" LibopusBaseCFLAGS = "-O3 -DNDEBUG" // Scalar C references retain the compiler's normal FMA contraction while // disabling loop and SLP vectorization to match the scalar Go arithmetic. LibopusScalarCVectorizationFlags = "-fno-tree-vectorize -fno-tree-slp-vectorize" LibopusScalarCFLAGS = LibopusBaseCFLAGS + " " + LibopusScalarCVectorizationFlags )
func ResolveLibopusCustomFixedQEXTReferenceVariant ¶ added in v0.2.0
func ResolveLibopusCustomFixedQEXTReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusCustomFixedQEXTReferenceVariant selects CUSTOM_MODES, FIXED_POINT, and ENABLE_QEXT with the current Go instruction lane.
func ResolveLibopusCustomFixedReferenceVariant ¶ added in v0.2.0
func ResolveLibopusCustomFixedReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusCustomFixedReferenceVariant selects CUSTOM_MODES and FIXED_POINT with the instruction lane paired to the current Go build.
func ResolveLibopusCustomQEXTReferenceVariant ¶ added in v0.2.0
func ResolveLibopusCustomQEXTReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusCustomQEXTReferenceVariant selects CUSTOM_MODES and ENABLE_QEXT with the instruction lane paired to the current Go build.
func ResolveLibopusDREDQEXTReferenceVariant ¶ added in v0.2.0
func ResolveLibopusDREDQEXTReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusDREDQEXTReferenceVariant selects ENABLE_DRED, ENABLE_DEEP_PLC, and ENABLE_QEXT with the instruction lane paired to the current Go build.
func ResolveLibopusFixedQEXTReferenceVariant ¶ added in v0.2.0
func ResolveLibopusFixedQEXTReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusFixedQEXTReferenceVariant selects FIXED_POINT and ENABLE_QEXT with the current Go build's scalar or SIMD instruction lane.
func ResolveLibopusFixedReferenceVariant ¶ added in v0.2.0
func ResolveLibopusFixedReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusFixedReferenceVariant selects FIXED_POINT with the current Go build's scalar or SIMD instruction lane.
func ResolveLibopusQEXTReferenceVariant ¶ added in v0.2.0
func ResolveLibopusQEXTReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusQEXTReferenceVariant selects the same instruction lane with ENABLE_QEXT compiled into the pinned reference.
func ResolveLibopusReferenceVariant ¶ added in v0.2.0
func ResolveLibopusReferenceVariant() (LibopusReferenceVariant, error)
ResolveLibopusReferenceVariant maps the current Go build and optional GOPUS_LIBOPUS_REF_SCALAR override to the matching explicit libopus tree. Empty or "auto" follows the build tags; scalar/1 and simd/0 can only confirm the matching lane and fail when they conflict with the Go build.