Skip to content

Session: Development Environment Fix & Velocity Script

Date: 2025-12-23 Focus: Developer experience improvements and tooling

Fixed a critical issue where OSS-CAD-SUITE tools (Yosys, Verilator) were not available in the Python virtual environment, causing RTL generation to fail. Also created a comprehensive repository velocity reporting script for investor metrics.

1. OSS-CAD-SUITE PATH Not in Virtual Environment

Section titled “1. OSS-CAD-SUITE PATH Not in Virtual Environment”

Problem: After running setup-dev-env.sh and activating .venv, the just ci command failed with:

amaranth._toolchain.yosys.YosysError: Could not find an acceptable Yosys binary.

Root Cause: The setup script installed OSS-CAD-SUITE to /opt/oss-cad-suite and added it to PATH during script execution, but this PATH change didn’t persist to new shells. The .venv/bin/activate script didn’t include the OSS-CAD-SUITE path.

Solution:

  1. Patched .venv/bin/activate to add /opt/oss-cad-suite/bin to PATH when sourcing
  2. Updated bin/setup-dev-env.sh to automatically apply this patch after creating the venv

Files Modified:

  • .venv/bin/activate (runtime fix)
  • bin/setup-dev-env.sh (permanent fix for future setups)

Request: Create a script to measure development velocity across branes-ai and stillwater-sc repositories for investor presentations.

Requirements:

  • Filter to source code files only (exclude generated content like .mlir files)
  • Exclude large files (>100k lines) that are likely data/generated
  • Show total LOC, commits, lines added/deleted, net change
  • Show percentage contribution relative to total codebase

Solution: Created scripts/repo_velocity.py with:

  • Tracking: C/C++, Python, Go, Shell, CMake, Verilog/VHDL files
  • Large file exclusion (>100k lines threshold)
  • Multiple output formats: markdown, CSV, JSON
  • Configurable date range (default: last 6 months)

Velocity Report Highlights (June - December 2025)

Section titled “Velocity Report Highlights (June - December 2025)”
Organization Total LOC Commits Net Change Growth
branes-ai 301,970 532 +207,654 +68.8%
stillwater-sc 442,102 289 +174,654 +39.5%
Combined 744,072 821 +382,308 +51.4%

Key Metrics:

  • 115.6 commits/month
  • +53,846 net LOC/month
  • 51.4% codebase growth in 7 months
  • scripts/repo_velocity.py - Repository velocity report generator
  • bin/setup-dev-env.sh - Added venv activation script patching
  • .venv/bin/activate - Added OSS-CAD-SUITE to PATH
  • CHANGELOG.md - Added entries for today’s work
Terminal window
# Default: last 6 months, markdown output
python3 scripts/repo_velocity.py
# Custom date range
python3 scripts/repo_velocity.py --since 2025-06-01 --until 2025-12-31
# CSV for spreadsheets
python3 scripts/repo_velocity.py --output csv > velocity.csv
# JSON for programmatic use
python3 scripts/repo_velocity.py --output json > velocity.json
Terminal window
# After setup, simply:
source .venv/bin/activate
just ci # Now works without additional environment sourcing

All 328 unit tests passing after the PATH fix:

============================= test session starts ==============================
collected 328 items
...
============================= 328 passed in X.XXs ==============================
  • The characterize (branes-ai) and flames (stillwater-sc) directories are not git repositories
  • The graphs repo had inflated LOC due to .mlir files, now filtered out
  • The velocity script is designed to be run periodically without consuming API tokens