Skip to content

Small tweaks to sync prototype implementations and design docs - #57

Merged
MarcoGorelli merged 5 commits into
benchx-dev:mainfrom
ev-br:prototype_impl_vs_design_docs
Oct 14, 2026
Merged

MarcoGorelli merged 5 commits into
benchx-dev:mainfrom
ev-br:prototype_impl_vs_design_docs

Conversation

@ev-br

@ev-br ev-br commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Asked Claude to check consistency between the docs and prototype implementations, and it came back with several items where they drifted. This PR fixes several small items which looked mostly straightforward, and three somewhat larger items are tracked in a WIP follow-up branch/PR in my fork, ev-br#3.

While at it, also added the --source-uri flag which Claude was asking for from his (theirs? what's the Claude AI pronoun) readonly sandbox I run it in.

ev-br's Claude Code Agent and others added 4 commits October 13, 2026 17:19
- bx head: size each column to its longest cell
- prototype README, prototype-design and prototype-scope: add bx bench,
  bx config, the pyperf adapter and the working_tree target kind
- pyperf-bench example: PYTHON= now also selects the benchmark workers
  (its directory goes first on PATH); note that any uncommitted change
  in the repository makes the result dirty

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ev-br
ev-br force-pushed the prototype_impl_vs_design_docs branch from 2abf398 to 2e214c8 Compare October 13, 2026 17:22
@MarcoGorelli

MarcoGorelli commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

thanks @ev-br !

i put this back into claude and it flagged:

  Correctness: source URI handling (prototype/benchx/session.py)
  1. SCP remote with an absolute path isn't converted (session.py:49). The regex rejects paths that start with /, so
     git@host:/srv/git/benchx.git comes through unchanged. It then fails the schema's format: uri check, so bx bench fails and bx compare
     refuses the orders. That's the failure this PR set out to fix, just for a different but common remote form.
  2. A local-path origin stays a bare path (session.py:66). If origin is /srv/git/benchx.git or ../upstream, the code doesn't turn it into a
     file:// URI. The fallback branch two lines below does, so the two branches disagree, and the new test asserts the bare path. That path also
     fails uri validation.
  3. Conversion only runs in one place (session.py:173). The provider's source.uri and the --source-uri flag skip it. One side can end up as
     git@github.com:org/repo.git and the other as ssh://git@github.com/org/repo.git, which triggers the "the sides report different source URIs"
     refusal. It would be better to normalize every candidate where the URI is chosen, or in identity._normalize_uri.
  4. Relative SCP paths change meaning (session.py:57). host:repos/x.git means ~/repos/x.git, but the code records ssh://host/repos/x.git, which
     means /repos/x.git. It should be ssh://host/~/repos/x.git. As written it points at a different repo and splits benchmark series.
  5. Edge cases in the regex (session.py:49):
     - A Windows drive path like C:\src\benchx is treated as host C. Git itself treats a one-letter prefix as a drive.
     - A bracketed IPv6 remote like git@[::1]:repo.git is split at the first colon inside the brackets, giving a malformed URI.


which Claude was asking for from his (theirs? what's the Claude AI pronoun)

i'd just say "its"

Handle absolute and relative SCP paths (relative ones become ssh://host/~/path),
local paths (file://), Windows drive paths and bracketed IPv6 hosts. Apply it to
the provider URI, --source-uri and origin, and to identity._normalize_uri, so
equivalent spellings of one remote no longer trip the "different source URIs"
refusal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ev-br

ev-br commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @MarcoGorelli ! Two Claude session, your and mine, seem to be in disagreement over how spell out relative URI paths. I've to admit I've no firm idea, so here's what my Claude session says about it:

Thanks, all the other points are fixed in e4a102b: absolute SCP paths, local-path
origins as file://, Windows drive paths, bracketed IPv6, and one normalize_remote
applied to the provider URI, --source-uri, origin and identity._normalize_uri.

I didn't take the relative-path suggestion as written. In the comment,
host:repos/x.git is said to mean /repos/x.git, and the code's output is said to mean
/repos/x.git as well. Those are the same path, so I think one of them is a typo. I'd
like to check I've read the intent correctly.

My understanding of git:

  • host:repos/x.git is relative to the login directory (usually the home directory),
    not the filesystem root.
  • ssh://host/repos/x.git and ssh://host//repos/x.git are both absolute: /repos/x.git,
    with the second only spelling the leading slash twice. So // would turn a
    home-relative remote into an absolute one, which is the change-of-meaning the
    comment warns about.
  • The common remote git@github.com:org/repo.git is a relative path. Rewriting it to
    ssh://git@github.com//org/repo.git would record a URI that doesn't match the real
    remote, and it would split benchmark series from anything recorded as
    ssh://git@github.com/org/repo.git.

So I kept ssh://host/~/repos/x.git, which preserves the home-relative meaning. The
code, tests and docs all say so. I haven't tested the ~ form against a real SSH
server, and some hosts reject ~ in ssh:// URIs.

Could you confirm which path you meant host:repos/x.git to map to? If you do want //,
it's a one-line change in normalize_remote, but I'd want to handle
git@github.com:org/repo.git as a special case first.

@MarcoGorelli MarcoGorelli 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.

thanks @ev-br !

looks good now, and the tests in test_remotes_becomes_uris look as-expected

happy to move forwards

@MarcoGorelli
MarcoGorelli merged commit fb81530 into benchx-dev:main Oct 14, 2026
4 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.

2 participants