Skip to content

perf(test): time the journey suite's shell steps between page phases - #11768

Merged
kyle-sexton merged 3 commits into
mainfrom
perf/8757-journey-shell-steps
Nov 1, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
perf/8757-journey-shell-steps

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #8757

Summary

After the phase 13 cut (#11592), surface-journey.test.sh's median on main is 134.5 s, not under 120 s. Its 20 page phases now sum to about 98 s, and nothing in the log says where the rest goes (#8757 (comment)). This PR adds the measurement the next cut needs: one ui_journey.shell: line with the wall milliseconds and count of each kind of shell step between page phases.

Fix

  • plugins/planning/surface/surface-checks.sh, journey block: a jtime <kind> <command> wrapper adds each step's EPOCHREALTIME duration to its kind, covering setup (add-round, first ensure-running), apply, handle, the fixed sleep 1, and the stop and restart in phases 18 to 20. After the phases' lines it prints ui_journey.shell: setup <ms>/<n> apply … handle … sleep … restart …. Without bash 5's EPOCHREALTIME the line reports ?.
  • A planning fragment, bump none (test-only).

Verification

  • Local run, WSL2: 254 checks pass, the suite takes 75 s. It printed ui_journey.shell: setup 349ms/2 apply 2690ms/24 handle 511ms/5 sleep 1002ms/1 restart 1305ms/2, so the shell steps total about 5.9 s. Most of CI's time outside the page phases is therefore elsewhere: likely the slot wait that TIME counts and the pw start-up per phase. This PR's CI log shows the same line on a runner.
  • bash -n and shellcheck -x on the script: clean.
  • Left out: no cut in this PR. It measures first, as the perf(test): cut the local affected-test gate's shell suites to a budget #8757 record asks.

Remaining

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits October 31, 2026 20:50
#8757's post-cut median is 134.5 s, but the 20 page phases sum to about 98 s,
and the shell steps between phases printed nothing, so the rest could not be
split. The journey block now prints one ui_journey.shell line: wall ms and
count per kind (setup, apply, handle, sleep, restart). A local run: 254
checks pass, the suite takes 75 s, and the shell steps total about 5.9 s.

Refs: #8757

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 1, 2026 00:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T00:53:36.542819Z 97edec3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97edec34b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed f2fc66ffdd4c1d98cb172592a3654031e306174f: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, since 97edec3)

Scope: plugins/planning/surface/surface-checks.sh. I read the single hunk in .claude-lane/incremental.diff and used the PR context for intent.

What changed: the jtime timing wrapper in the journey test block now copies EPOCHREALTIME with an unset-safe expansion (${EPOCHREALTIME:-}), both before and after the wrapped command. It only does the millisecond arithmetic when both readings are non-empty. On bash 4, where the variable isn't set, the timing line falls back to ?.

Assessment: I found no security issues. The change is test-only timing instrumentation.

  • The wrapped command still runs as "${@:2}", quoted, and its exit code is still returned. Nothing new is executed, and no quoting was loosened.
  • The values that reach $(( )) come from bash's own EPOCHREALTIME in the test runner's environment. No pull request, issue or comment text reaches them, so no untrusted input gets into the arithmetic.
  • The change touches no tokens, secrets, trust controls, merge holds, workflows or plugin manifests. It doesn't edit any instruction surface or match any trusted path.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 97edec34b879c77a260235ba24fb9836775a6240; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed f2fc66ffdd4c1d98cb172592a3654031e306174f: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental since 97edec3): no findings

Scope: I reviewed only the change since 97edec3, which is the jtime helper in plugins/planning/surface/surface-checks.sh (lines 346–356). I read that whole change, and I used the full PR diff and the head file for context.

What changed: Before, jtime read ${EPOCHREALTIME/./} directly. On bash 4 the variable doesn't exist, and because the script runs under set -u (line 17), that read was an unbound-variable error. The new code reads both timestamps with ${EPOCHREALTIME:-}. It adds to jms and jcount only when both timestamps are set, and it removes the . from each one only at the subtraction.

Checks:

  • Bash 4: t0 and t1 are both empty, so nothing is added. The summary line at L484 then prints ?ms/0 for each kind, which matches the "reports '?'" comment at L344.
  • Bash 5: EPOCHREALTIME always has 6 microsecond digits, so removing the . and subtracting gives the right number of microseconds. Dividing by 1000 gives milliseconds, as before.
  • Exit code: rc still holds the wrapped command's status. t1 is read after rc=$?, so it doesn't change rc, and jtime returns that status unchanged. Callers that do || bad … (L373) still work as before.

I have not run the suite or a shell. The PR's local-run and CI-log results are the author's claims, and I haven't checked them.

PR context: The PR refs #8757 but closes no issue, so there are no acceptance criteria to check. The PR description contains no embedded instructions.

Under set -u, ${EPOCHREALTIME/./} on a shell without it stopped the suite
before the wrapped step ran. Both reads now use ${EPOCHREALTIME:-}.

Refs: #8757

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 312a9f2 Nov 1, 2026
68 checks passed
@kyle-sexton
kyle-sexton deleted the perf/8757-journey-shell-steps branch November 1, 2026 03:01
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.

1 participant