Skip to content

e2e-ish: add native Go verification. - #846

Merged
askervin merged 2 commits into
stacked/klihub/e2eish/generated-testsfrom
stacked/klihub/e2eish/go-verification
Oct 22, 2026
Merged

askervin merged 2 commits into
stacked/klihub/e2eish/generated-testsfrom
stacked/klihub/e2eish/go-verification

Conversation

@klihub

@klihub klihub commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Translate logged python verify expressions of e2e tests into testify require assertions in Go, falling back to python if we lack necessary state. The replay cross-checks the Go state against python at every assertion.

@klihub
klihub added this pull request to stack #848 October 14, 2026 15:07
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 4c66ff1 to 5107c4c Compare October 14, 2026 15:19
@klihub klihub changed the title stacked/klihub/e2eish/go verification e2e-ish: add native Go verification. Oct 14, 2026
@askervin
askervin force-pushed the stacked/klihub/e2eish/go-verification branch from 5107c4c to 38061c2 Compare October 15, 2026 06:14
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 38061c2 to 8f28ad3 Compare October 15, 2026 07:05
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch 2 times, most recently from 14bbf78 to 61fcd66 Compare October 16, 2026 17:26
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch 2 times, most recently from 0d115b9 to a14ed6f Compare October 16, 2026 17:44
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from a14ed6f to 38b6b3b Compare October 19, 2026 15:15
@bart0sh
bart0sh force-pushed the stacked/klihub/e2eish/go-verification branch from 38b6b3b to 94a0b01 Compare October 19, 2026 15:25
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 94a0b01 to 2cfbc90 Compare October 19, 2026 18:14
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 2cfbc90 to f96b6df Compare October 20, 2026 07:55
@klihub
klihub removed this pull request from stack #848 October 20, 2026 08:38
@klihub
klihub added this pull request to stack #867 October 20, 2026 08:39
@bart0sh
bart0sh force-pushed the stacked/klihub/e2eish/go-verification branch from f96b6df to cd6647e Compare October 20, 2026 09:11
@bart0sh
bart0sh requested a balanced review from Copilot October 20, 2026 10:22

@bart0sh bart0sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done with Claude Code, I checked the findings.

I compared the translations against python3 on about 90 expressions, and every shape the translator supports agrees with python. All tests, lint and race are clean, and with #847 on top the generated tests drop from about 88s to about 24s. A few small things inline, none of them block the PR from my side.

Comment thread pkg/testutils/e2eish/pyexpr.go Outdated
Comment thread pkg/testutils/e2eish/pygo.go Outdated
Comment thread test/e2e/README.md
Comment thread pkg/testutils/e2eish/script.go Outdated
Comment thread pkg/testutils/e2eish/set.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Duplicate integer literals change assertion results, and allocation changes can cause false cross-check failures.

2 open issues
What changed in this PR

Adds native Go verification to the e2e log replay tooling, reducing reliance on Python.

Changes:

  • Translates supported Python expressions into Go assertions.
  • Adds topology state accessors and set helpers.
  • Cross-checks Go state against Python while retaining fallback verification.
File Description
test/​e2e/​README.md Documents native assertions and Python fallback.
pkg/​testutils/​e2eish/​state.go Adds topology names and state accessors.
pkg/​testutils/​e2eish/​state_test.go Tests topology naming and missing-Python behavior.
pkg/​testutils/​e2eish/​set.go Adds set operations and assertions.
pkg/​testutils/​e2eish/​set_test.go Tests set helpers.
pkg/​testutils/​e2eish/​script.go Adds state cross-checks and Python reporting.
pkg/​testutils/​e2eish/​script_test.go Tests reporting and container visibility.
pkg/​testutils/​e2eish/​replay.go Captures Python state during verification.
pkg/​testutils/​e2eish/​pygo.go Translates Python expressions into Go assertions.
pkg/​testutils/​e2eish/​pygo_test.go Tests translation and fallback cases.
pkg/​testutils/​e2eish/​pyexpr.go Parses supported Python expressions.
pkg/​testutils/​e2eish/​generate.go Emits native assertions and prunes unused Python constants.

Review effort: Balanced

Comment thread pkg/testutils/e2eish/pygo.go Outdated
Comment thread pkg/testutils/e2eish/script.go Outdated
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from cd6647e to 775f9e8 Compare October 20, 2026 11:25
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 775f9e8 to 93e5f5e Compare October 20, 2026 11:33
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from d9bf370 to 328248a Compare October 20, 2026 20:15
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 328248a to 526633d Compare October 21, 2026 09:10
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 526633d to 42ef9af Compare October 21, 2026 11:39
@klihub
klihub requested a balanced review from Copilot October 21, 2026 12:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Native assertions can mix allocation states across timer-driven updates and fail incorrectly.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread pkg/testutils/e2eish/state.go
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 42ef9af to 72cc86d Compare October 21, 2026 15:01
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 72cc86d to da546a2 Compare October 21, 2026 15:03
@klihub
klihub requested a balanced review from Copilot October 21, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Node-literal translation can change assertion results when NUMA is disabled.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread pkg/testutils/e2eish/generate.go
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from da546a2 to e01923f Compare October 21, 2026 17:12
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from e01923f to 42748d1 Compare October 21, 2026 19:31
@klihub
klihub requested a balanced review from Copilot October 21, 2026 19:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The custom translator and topology reconstruction need human validation of semantic equivalence between Go and Python.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Add Set, a set of topology.py names, and Script accessors
which compute in Go what the verify expressions of e2e tests
see of a container: CPUs, Mems, Nodes, Cores, Threads, Dies
and Packages, and CPUIDs, NodeIDs and PackageIDs for
literals. RequireDisjoint and IDs are disjoint_sets and the
*_ids helpers.

At every assertion of a replay, python also prints the state
it sees, and the replay requires the accessors to give the
same. With no python3, a generated test skips only its
python assertions, while a replay still skips.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Translate the verify expressions of e2e test logs into
require assertions on the state of the Script, like
require.Len(t, s.CPUs("pod0c0"), 1), with a parser for the
python subset the logs use. An expression of another shape,
or one whose Go would not mean the same, stays python. A
literal becomes CPUIDs and the like only if it is padded as
the machine pads it.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub
klihub force-pushed the stacked/klihub/e2eish/go-verification branch from 42748d1 to 06e5838 Compare October 22, 2026 07:14

@bart0sh bart0sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@askervin askervin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@askervin
askervin merged commit da09f42 into main Oct 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants