Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/aioe/simulate_test.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/aioe/simulate_test.go |
| Original SHA-256 | 1b88187c9a2e2939464c2b892738e7d88eddb7b28b306314005a99aecf156bab |
| Git blob SHA | b36f1e09b1864b02373d59a84aa5467d2de3ac07 |
| Reading-copy SHA-256 | 1b88187c9a2e2939464c2b892738e7d88eddb7b28b306314005a99aecf156bab |
Every recorded occurrence
These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / internal/aioe/simulate_test.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/aioe/simulate_test.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
Recovered source transcript
Download complete source text ↓50 lines · 1.8 KB
package aioe
import "testing"
// TestSimulationCharacterization is the calibration proof for the model card: across every standard
// regime the sum stays exactly 1, the clamps always hold, and the directional regimes move the
// intended dimension the intended way while noise leaves the weights put.
func TestSimulationCharacterization(t *testing.T) {
p := DefaultParams()
byName := map[string]Simulation{}
for _, r := range StandardRegimes() {
s := Simulate(r, 40, 200, p)
if !s.SumAlways1 {
t.Fatalf("regime %s broke the sum-to-one invariant", r.Name)
}
if !s.ClampsHeld {
t.Fatalf("regime %s escaped the clamps", r.Name)
}
byName[r.Name] = s
}
if !byName["rewards-skills"].End["skills"].GreaterThan(byName["rewards-skills"].Start["skills"]) {
t.Fatal("rewards-skills must raise the skills weight")
}
if !byName["penalizes-location"].End["location"].LessThan(byName["penalizes-location"].Start["location"]) {
t.Fatal("penalizes-location must lower the location weight")
}
// Pure noise must not meaningfully move any weight (within a grain or two of rounding).
noise := byName["pure-noise"]
for _, d := range Dimensions {
if noise.End[d].Sub(noise.Start[d]).Abs().GreaterThan(dec("0.001")) {
t.Fatalf("pure noise moved %s by more than a rounding grain: %s -> %s", d, noise.Start[d], noise.End[d])
}
}
// The adversarial flip must stay bounded (clamps held above) and not blow the sum.
if !byName["adversarial-flip"].SumAlways1 {
t.Fatal("adversarial flip broke the sum invariant")
}
}
func TestSimulateIsDeterministic(t *testing.T) {
p := DefaultParams()
r := StandardRegimes()[0]
a := Simulate(r, 30, 100, p)
b := Simulate(r, 30, 100, p)
if a.Report() != b.Report() {
t.Fatal("same regime and params must produce an identical report")
}
}