Documentation
¶
Index ¶
- Constants
- func PublishEngineCapability(outputRoot string, capability EngineCapability) (string, error)
- func ValidateProjectedImageFixture(data []byte, fixture Fixture) error
- type Artifact
- type ArtifactBundle
- type ArtifactPublisher
- type DiagnosticArtifact
- type EngineCapability
- type Fixture
- type Measurement
- type ProjectedImage
- func (p *ProjectedImage) Measure(ctx context.Context, request SampleRequest) (Measurement, error)
- func (p *ProjectedImage) MeasureUntraced(ctx context.Context, request SampleRequest) (Sample, error)
- func (p *ProjectedImage) Restart(ctx context.Context, _ SampleRequest) error
- func (p *ProjectedImage) Setup(ctx context.Context) (RunMetadata, error)
- func (p *ProjectedImage) Validate(ctx context.Context, request SampleRequest, sample Sample) error
- func (p *ProjectedImage) ValidateUntraced(ctx context.Context, request SampleRequest, sample Sample) error
- type ProjectedImageConfig
- type RunMetadata
- type Runner
- type Sample
- type SampleKind
- type SampleRequest
- type SamplingPolicy
- type StateBoundary
- type Summary
- type Workload
Constants ¶
const ( // ProjectedImageWidth is the fixed fixture width in pixels. ProjectedImageWidth = 1024 // ProjectedImageHeight is the fixed fixture height in pixels. ProjectedImageHeight = 1024 // ProjectedImageFixturePath is the fixed UnixFS path for the benchmark image. ProjectedImageFixturePath = "goscriptbench-projected-image-v1.png" )
const ( // WarmupSampleCount is the number of complete rows discarded before retention. WarmupSampleCount = 1 // RetainedSampleCount is the fixed per-engine scalar population. RetainedSampleCount = 10 // DiagnosticSampleCount is the separately traced sample population. DiagnosticSampleCount = 1 // SummaryMethodNearestRank identifies the retained percentile algorithm. SummaryMethodNearestRank = "nearest-rank" )
Variables ¶
This section is empty.
Functions ¶
func PublishEngineCapability ¶
func PublishEngineCapability(outputRoot string, capability EngineCapability) (string, error)
PublishEngineCapability atomically exposes one unsupported engine record.
func ValidateProjectedImageFixture ¶
ValidateProjectedImageFixture checks the encoded bytes against their recorded identity.
Types ¶
type Artifact ¶
type Artifact struct {
// schemaVersion identifies the artifact format
SchemaVersion int
// metadata identifies the engine, fixture, revisions, and state boundary
Metadata RunMetadata
// sampling records fixed population sizes and summary method
Sampling SamplingPolicy
// warmup is the complete row excluded from the scalar population
Warmup Sample
// samples are the retained source rows in execution order
Samples []Sample
// summary is derived only from samples
Summary Summary
}
Artifact is one engine's untraced scalar result.
type ArtifactBundle ¶
type ArtifactBundle struct {
// result contains the untraced distribution
Result Artifact
// diagnostic contains the traced sample
Diagnostic DiagnosticArtifact
// runtimeTrace contains the separately captured diagnostic trace
RuntimeTrace []byte
// browserCPUProfile contains optional Chromium-only diagnostic evidence
BrowserCPUProfile []byte
}
ArtifactBundle groups one scalar result with its separate diagnostic.
func ReadArtifact ¶
func ReadArtifact(dir string) (*ArtifactBundle, error)
ReadArtifact verifies and decodes one published per-engine artifact directory.
func (ArtifactBundle) Validate ¶
func (b ArtifactBundle) Validate() error
Validate checks both artifacts and unique sample custody across them.
type ArtifactPublisher ¶
type ArtifactPublisher struct {
// contains filtered or unexported fields
}
ArtifactPublisher atomically exposes complete per-engine artifact directories.
func NewArtifactPublisher ¶
func NewArtifactPublisher(outputRoot string) (*ArtifactPublisher, error)
NewArtifactPublisher constructs a publisher rooted at outputRoot.
func (*ArtifactPublisher) Publish ¶
func (p *ArtifactPublisher) Publish(bundle ArtifactBundle) (string, error)
Publish validates and atomically exposes one per-engine artifact bundle.
type DiagnosticArtifact ¶
type DiagnosticArtifact struct {
// schemaVersion identifies the artifact format
SchemaVersion int
// runID links the diagnostic to its scalar result
RunID string
// engine links the diagnostic to its browser engine
Engine string
// sample is excluded from the retained scalar population
Sample Sample
// runtimeTraceFile names the required runtime trace
RuntimeTraceFile string
// browserCPUProfileFile names optional Chromium-only CPU evidence
BrowserCPUProfileFile string
}
DiagnosticArtifact is the separately traced sample for one engine result.
func (DiagnosticArtifact) Validate ¶
func (d DiagnosticArtifact) Validate(metadata RunMetadata) error
Validate checks that the diagnostic is complete and traced.
type EngineCapability ¶
type EngineCapability struct {
SchemaVersion int
RunID string
Engine string
EngineVersion string
Capability string
Status string
Reason string
}
EngineCapability records why an engine cannot enter the benchmark workload.
func ReadEngineCapability ¶
func ReadEngineCapability(dir string) (EngineCapability, error)
ReadEngineCapability validates one published unsupported engine record.
func (EngineCapability) Validate ¶
func (c EngineCapability) Validate() error
Validate checks that an unsupported capability record is complete.
type Fixture ¶
type Fixture struct {
// generator names the deterministic fixture algorithm
Generator string
// generatorRevision identifies the generator contract
GeneratorRevision string
// encoder names the fixture encoder
Encoder string
// encoderEnvironment identifies the encoder runtime
EncoderEnvironment string
// SHA256 is the lowercase hexadecimal digest of the encoded fixture
SHA256 string
// encodedBytes is the encoded fixture size
EncodedBytes int64
// width is the decoded fixture width
Width int
// height is the decoded fixture height
Height int
// colorModel names the decoded fixture color model
ColorModel string
// path is the fixture path inside the measured storage system
Path string
}
Fixture identifies the bytes and environment used by one benchmark run.
func GenerateProjectedImageFixture ¶
GenerateProjectedImageFixture creates the fixed low-compressibility PNG and its identity.
type Measurement ¶
type Measurement struct {
// sample is the browser-local timing row
Sample Sample
// runtimeTrace is present only for the traced diagnostic
RuntimeTrace []byte
// browserCPUProfile is optional Chromium-only diagnostic evidence
BrowserCPUProfile []byte
}
Measurement groups one sample with evidence captured in the same window.
func (Measurement) Validate ¶
func (m Measurement) Validate(request SampleRequest, metadata RunMetadata) error
Validate checks sample trace state and diagnostic evidence custody.
type ProjectedImage ¶
type ProjectedImage struct {
// contains filtered or unexported fields
}
ProjectedImage sets up and restarts the retained-OPFS image workload.
func NewProjectedImage ¶
func NewProjectedImage(t testing.TB, harness *wasm.Harness, config ProjectedImageConfig) (*ProjectedImage, error)
NewProjectedImage constructs the retained-OPFS image workload.
func (*ProjectedImage) Measure ¶
func (p *ProjectedImage) Measure(ctx context.Context, request SampleRequest) (Measurement, error)
Measure runs one scalar or diagnostic projected-image sample after Restart.
func (*ProjectedImage) MeasureUntraced ¶
func (p *ProjectedImage) MeasureUntraced(ctx context.Context, request SampleRequest) (Sample, error)
MeasureUntraced runs one scalar projected-image sample after Restart.
func (*ProjectedImage) Restart ¶
func (p *ProjectedImage) Restart(ctx context.Context, _ SampleRequest) error
Restart replaces the page and dedicated runtime, then verifies the retained fixture.
func (*ProjectedImage) Setup ¶
func (p *ProjectedImage) Setup(ctx context.Context) (RunMetadata, error)
Setup generates, uploads, and reads back the fixture before sampling begins.
func (*ProjectedImage) Validate ¶
func (p *ProjectedImage) Validate( ctx context.Context, request SampleRequest, sample Sample, ) error
Validate checks one scalar or diagnostic sample against its request and fixture.
func (*ProjectedImage) ValidateUntraced ¶
func (p *ProjectedImage) ValidateUntraced( ctx context.Context, request SampleRequest, sample Sample, ) error
ValidateUntraced checks one scalar sample against its request and fixture.
type ProjectedImageConfig ¶
type ProjectedImageConfig struct {
// runID groups this result with other engine processes
RunID string
// engine names the selected Playwright browser
Engine string
// spacewaveRevision identifies the Spacewave source tree
SpacewaveRevision string
// goScriptRevision identifies the GoScript source tree
GoScriptRevision string
UnavailableFields []string
// browserCPUProfile enables optional same-window Chromium profiling
BrowserCPUProfile bool
}
ProjectedImageConfig identifies the source and engine for one workload run.
func (ProjectedImageConfig) Validate ¶
func (c ProjectedImageConfig) Validate() error
Validate checks the workload identity before browser setup begins.
type RunMetadata ¶
type RunMetadata struct {
// runID groups independent engine results from one matrix invocation
RunID string
// engine names the selected browser engine
Engine string
// engineVersion identifies the launched browser binary
EngineVersion string
// compiler names the Go-to-browser compiler
Compiler string
// spacewaveRevision identifies the Spacewave source tree
SpacewaveRevision string
// goScriptRevision identifies the GoScript source tree
GoScriptRevision string
// buildMode names the measured build shape
BuildMode string
// workerMode names the GoScript runtime worker shape
WorkerMode string
// storageBackend names the measured persistent storage backend
StorageBackend string
// runtimeState names the retained and recreated cache cell
RuntimeState string
// projectedURLTemplate identifies the measured request family
ProjectedURLTemplate string
// fixture identifies the measured bytes
Fixture Fixture
// state declares the boundary between samples
State StateBoundary
UnavailableFields []string
}
RunMetadata identifies one engine run and its measured state boundary.
func (RunMetadata) Validate ¶
func (m RunMetadata) Validate() error
Validate checks that the run identity and state boundary are complete.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes fixed benchmark populations and publishes validated artifacts.
type Sample ¶
type Sample struct {
// ID uniquely identifies the sample within one engine run
ID string
// requestStartMs is the projected URL assignment time relative to sample start
RequestStartMs float64
// responseStartMs is the matching resource response start
ResponseStartMs float64
// responseEndMs is the matching resource response end
ResponseEndMs float64
// loadMs is the image load event time
LoadMs float64
// decodeMs is the image decode completion time
DecodeMs float64
// frameMs is the first animation frame after decode
FrameMs float64
// displayReadyMs is the retained scalar and equals frameMs
DisplayReadyMs float64
// naturalWidth is the decoded image width
NaturalWidth int
// naturalHeight is the decoded image height
NaturalHeight int
// transferSize is the browser-reported transferred byte count
TransferSize int64
// decodedBodySize is the browser-reported decoded body byte count
DecodedBodySize int64
// traced reports whether diagnostic tracing was enabled
Traced bool
}
Sample records one browser-local projected-image measurement.
func (Sample) Validate ¶
func (s Sample) Validate(metadata RunMetadata) error
Validate checks that the sample is complete for the run metadata.
type SampleKind ¶
type SampleKind string
SampleKind identifies a warm-up, retained, or diagnostic action.
const ( // SampleKindWarmup identifies the discarded untraced warm-up. SampleKindWarmup SampleKind = "warmup" // SampleKindRetained identifies one untraced source row. SampleKindRetained SampleKind = "retained" // SampleKindDiagnostic identifies the separately traced diagnostic. SampleKindDiagnostic SampleKind = "diagnostic" )
type SampleRequest ¶
type SampleRequest struct {
// kind identifies the sample population
Kind SampleKind
// number is one-based within the sample population
Number int
// trace enables diagnostic tracing for this action
Trace bool
}
SampleRequest describes one action the runner asks a workload to perform.
type SamplingPolicy ¶
type SamplingPolicy struct {
// warmupSamples is the discarded sample count
WarmupSamples int
// retainedSamples is the untraced scalar sample count
RetainedSamples int
// diagnosticSamples is the traced sample count
DiagnosticSamples int
// summaryMethod names the percentile algorithm
SummaryMethod string
}
SamplingPolicy records the fixed populations and summary method.
func (SamplingPolicy) Validate ¶
func (p SamplingPolicy) Validate() error
Validate checks that the artifact uses the selected fixed sampling contract.
type StateBoundary ¶
type StateBoundary struct {
// retained names state preserved between samples
Retained []string
// recreated names state replaced between samples
Recreated []string
}
StateBoundary declares state retained and recreated between samples.
func (StateBoundary) Validate ¶
func (s StateBoundary) Validate() error
Validate checks that every state declaration is present and unambiguous.
type Summary ¶
type Summary struct {
// method names the percentile algorithm
Method string
// sampleCount is the number of retained source rows
SampleCount int
// medianDisplayReadyMs is the nearest-rank p50
MedianDisplayReadyMs float64
// p95DisplayReadyMs is the nearest-rank p95
P95DisplayReadyMs float64
}
Summary records nearest-rank statistics derived from retained source rows.
func SummarizeSamples ¶
SummarizeSamples derives nearest-rank p50 and p95 without reordering source rows.
type Workload ¶
type Workload interface {
Setup(ctx context.Context) (RunMetadata, error)
Restart(ctx context.Context, request SampleRequest) error
Measure(ctx context.Context, request SampleRequest) (Measurement, error)
Validate(ctx context.Context, request SampleRequest, sample Sample) error
}
Workload supplies setup, restart, measurement, and validation behavior to a Runner.
Source Files
¶
- artifact-bundle.go
- artifact-json.go
- artifact-publisher.go
- artifact.go
- diagnostic-artifact.go
- engine-capability.go
- fixture.go
- measurement.go
- projected-image-config.go
- projected-image-cpu-profile.go
- projected-image-fixture.go
- projected-image-measure.go
- projected-image.go
- run-metadata.go
- runner.go
- sample-request.go
- sample.go
- sampling-policy.go
- state-boundary.go
- summary.go
- workload.go