Skip to content

[Scripts] Add worktree setup script and docs#229

Merged
YWHyuk merged 1 commit into
developfrom
feature/worktree-setup-script
May 22, 2026
Merged

[Scripts] Add worktree setup script and docs#229
YWHyuk merged 1 commit into
developfrom
feature/worktree-setup-script

Conversation

@YWHyuk
Copy link
Copy Markdown
Collaborator

@YWHyuk YWHyuk commented May 22, 2026

Summary

  • scripts/setup_worktree.sh creates a sibling git worktree off a base ref (default origin/develop), writes a per-worktree .envrc, and unsets upstream tracking so the first git push does not target develop.
  • The generated .envrc overrides TORCHSIM_DIR, TORCHSIM_DUMP_PATH, TORCHSIM_LOG_PATH, TOGSIM_CONFIG, and prepends the worktree's PyTorchSimDevice to PYTHONPATH so import torch_openreg resolves to the active worktree's .so even though the conda-wide editable install points at one fixed worktree.
  • docs/worktrees.md walks through the workflow, the three things the script keeps in sync, and why build_ext --inplace is preferred over re-running pip install -e per worktree.

Container-dedicated: GEM5_PATH, TORCHSIM_LLVM_PATH, RISCV are hardcoded to the ghcr.io/psal-postech/torchsim-ci layout.

Adds scripts/setup_worktree.sh which creates a sibling git worktree off a
base ref (default origin/develop), writes a per-worktree .envrc that sets
TORCHSIM_DIR / dump / log / config paths and a PYTHONPATH override so the
conda-wide editable install of torch_openreg does not pin every worktree
to the same .so, and unsets upstream tracking so the first git push lands
on the new branch instead of develop.

docs/worktrees.md documents usage, the three things the script keeps in
sync, and the build_ext --inplace vs pip install -e tradeoff.

Container-dedicated: GEM5_PATH, TORCHSIM_LLVM_PATH, and RISCV are hardcoded
to the ghcr.io/psal-postech/torchsim-ci layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@YWHyuk YWHyuk merged commit d89b51e into develop May 22, 2026
21 of 68 checks passed
@YWHyuk YWHyuk deleted the feature/worktree-setup-script branch May 22, 2026 12:13
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