Repository navigation
revert: #4802 path CheckRoot (zero measured gain on the CI bench) - #4855
Conversation
… class CI bench (paired CPU, 3 runners x interleaved pairs): f0dab6c -> 394e93c tree-10 run 45075725397 paired 1.000-1.009 on no-op/warm/fresh/frozen; tree-50 run 45076262295 paired 1.002 no-op, 1.010 locked-warm. Below the PERF landing bar (>= 2x or >= 30%), so the CheckRoot class, its AST guard and the bypass mutations are removed; #4761's resolve-once stays. Refs #4732 Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the containment-check rollback.
No open issues 🎉
What changed in this PR
Reverts #4802’s CheckRoot containment optimization after CI benchmarks showed no measurable gain, while preserving #4761’s resolve-once improvements in deployment path handling.
Changes:
- Removes
CheckRootand restores containment checks using the existing resolution helpers. - Restores
candidate_resolvedhandling in deployment locator callers. - Removes the dedicated lifetime guard and its associated tests and bypass mutations.
| File | Description |
|---|---|
tests/unit/test_path_security_io.py |
Removes tests specific to CheckRoot. |
tests/integration/test_architecture_confirmed_bypass_mutations.py |
Removes CheckRoot lifetime bypass mutations. |
src/apm_cli/utils/path_security.py |
Removes the CheckRoot implementation. |
src/apm_cli/install/deployed_paths.py |
Restores lazy, once-per-call candidate resolution. |
src/apm_cli/core/deployment_ledger.py |
Restores resolution helpers and candidate_resolved handling. |
scripts/architecture_linter/checks/transport_auth_platform.py |
Removes registration and scanning for CheckRoot lifetime checks. |
scripts/architecture_linter/checks/path_check_root.py |
Deletes the dedicated lifetime guard. |
Review effort: Balanced
|
HOLD (PERF VP v2, regent order 00:50): not landing until a macOS re-bench decides. The 1.00x verdicts above are from Linux runners, where lstat is cheapest, while #4802 targets an lstat storm. macOS paired runs at tree-10 and tree-50 decide: KEEP if #4802 meets the bar on any OS users run, REVERT only if it's ~1.0x everywhere. |
|
HOLD LIFTED (PERF VP v2): the cross-OS verdict is REVERT. #4802 shows no measurable CPU change on any OS (paired CPU, base f0dab6c -> 394e93c):
|
main's revert left the module at 2101 lines; fold the skills filter into the loop header (no behavior change). Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The microsoft#4802 revert (microsoft#4855) and microsoft#4818 landed together and took the file to 2101 lines. The restored _encode call takes one formatted line, as it did before the revert; no behavior change. Co-authored-by: Copilot App <[email protected]>
Description
Reverts #4802 (merge 8710b95, shipped in v0.38.0). Its containment change measured zero gain on the CI bench, and it adds a security-sensitive class (
CheckRoot), a closed-world AST guard and 7 bypass mutations to maintain.Both runs compare base f0dab6c with new 394e93c, using paired CPU (user+sys incl. children) on 3 runners with interleaved pairs. The A/A noise floor is about 1% (run 45076411610).
The PERF landing bar is >= 2x or >= 30% of the journey, so this is a removal of zero-benefit complexity, ordered by the regent after the tag. #4761's resolve-once (the measured part of the same lane) is untouched.
Issue and approved scope
Issue: Refs #4732
Human scope-approval comment: revert of a merged change under the PERF landing bar, ordered by the regent (PERF VP v2 plan.md, 23:4x); same scope as #4802's record, removed.
Does this PR complete the issue, or what remains? #4732's remaining scope is unchanged by this revert.
Type of change
Testing
Validation evidence (worktree source via
PYTHONPATH=src):pytest -n 2 tests/unit/test_path_security_io.py tests/unit/scripts/test_architecture_runner.py tests/unit/install/ -k "path or deployed or ledger or runner or locator": 556 passed.uvx [email protected] checkandformat --checkon src/, tests/ and the architecture linter: passed.python scripts/lint_architecture_boundaries.py --root .: no findings.path_check_rootorCheckRoot.Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
Not applicable.