Skip to content

experimental: multitasked configure build#28

Merged
RedFox20 merged 1 commit into
masterfrom
experimental/multitasked-configure-build
Jul 22, 2026
Merged

experimental: multitasked configure build#28
RedFox20 merged 1 commit into
masterfrom
experimental/multitasked-configure-build

Conversation

@RedFox20

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI 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.

Pull request overview

This PR introduces an experimental “unified” parallel scheduler that can interleave dependency load/configure/build work, improves subprocess/captured-output behavior for live displays, and adds new tooling around build timing/insights and compiler/toolchain stability.

Changes:

  • Add a parallel DAG scheduler and unified execution path for dynamic dependency graphs (including fail-fast + resource governors).
  • Improve subprocess handling (idle timeout, tree-kill, output draining, capture-context propagation) and route output safely through the live display/capture sinks.
  • Add build observability and correctness improvements (buildtimes/buildstats reporting, compiler-scoped build dirs, compiler detection caching, git output noise/progress filtering), with extensive new test coverage.

Reviewed changes

Copilot reviewed 62 out of 63 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/testutils.py Adds shared ANSI stripping + base fake target helpers for new scheduler/runner tests.
tests/test_unified_scheduler/test_unified_scheduler.py New tests for unified scheduler graph growth and diamond deduping.
tests/test_target_scoped_build/test_target_scoped_build.py New tests pinning targeted builds still building missing/unbuilt deps.
tests/test_target_args/test_target_args.py New tests for unused-arg target inference and early failure on option-like typos.
tests/test_sub_process/test_sub_process.py Expanded subprocess tests (drain-on-exit, capture propagation, idle timeout, Ctrl+C termination, execute_echo behavior).
tests/test_ssh_multiplex/test_ssh_multiplex.py Updates expectations to include always-on SSH safety options.
tests/test_requires_version/test_requires_version.py New tests for version parsing/comparison and requires_version() behavior.
tests/test_rebuild_clean_shim/test_rebuild_clean_shim.py New tests for rebuild/clean behavior with cached artifactory shims.
tests/test_proc_cpu/test_proc_cpu.py New tests for process-tree CPU sampling correctness and performance.
tests/test_parallel_runner/test_parallel_runner.py New tests pinning parallel runner ordering, fail-fast, diagnostics, and helper utilities.
tests/test_parallel_load/test_parallel_load.py New tests for thread-safe dep registry and load() serialization under parallel load.
tests/test_papa_parse/test_papa_parse.py Adds tests for new papa compiler record parsing/backwards compatibility.
tests/test_msvc_toolset/test_msvc_toolset.py New tests for selecting newest valid MSVC toolset numerically.
tests/test_log_writer/test_log_writer.py New tests for AsyncLogWriter ordering, ANSI stripping, flushing, and robustness.
tests/test_hierarchical_libs/test_hierarchical_libs.py New tests for stable hierarchical lib ordering/dedup; includes optional real-toolchain validation.
tests/test_git_url_override/test_git_url_override.py Extends git helper tests for output-noise filtering and progress collapsing.
tests/test_git_local_mods/test_git_local_mods.py New tests for loud failure on dirty trees during update paths.
tests/test_configure_build_split/test_configure_build_split.py New tests pinning configure/build split, per-target -j sizing, env safety, and TU counting.
tests/test_compiler_scoped_dirs/test_compiler_scoped_dirs.py New tests for compiler lock + build-dir re-resolution after compiler choice.
tests/test_compiler_scoped_dirs/test_compiler_mismatch_warning.py New tests for warning on compiler-stamped package mismatches.
tests/test_compiler_cache/test_flag_isolation.py New integration tests for compiler seed cache not leaking project flags.
tests/test_compile_commands/test_compile_commands.py Adds tests for platform-config matching that avoids selecting the “other compiler” config.
tests/test_cmake_cache_repair/test_cmake_cache_repair.py New tests for detecting/wiping half-configured build dirs and rerunnable error detection.
tests/test_clone_timing/test_clone_timing.py Adjusts expected time formatting threshold behavior (<0.1s uses ms).
tests/test_clean_only/test_clean_only.py New tests ensuring clean-only stops after cleaning (no execute chain).
tests/test_clang_stdlib/test_clang_stdlib.py New tests for clang stdlib selection and opt-in libstdc++ mode.
tests/test_buildtimes/test_buildtimes.py New tests for buildtimes bar rendering, glyph fallback, caching, sorting, and phase timing.
tests/test_build_scheduler/test_build_scheduler.py New comprehensive tests for scheduler governors, priorities, grow(), fail-fast, and barriers.
tests/test_build_insights/test_build_insights.py New tests for MSVC/clang trace parsing and deep build insights reporting.
tests/test_build_dir/test_build_dir.py Adds tests for compiler-scoped build dir naming and suffix ordering.
tests/test_build_config/test_build_config.py New tests for default jobs policy, conflict-note once-only behavior, and buildstats alias.
tests/test_build_banner/test_build_banner.py New tests for banner verb/target-count/toolchain reporting behavior.
tests/test_artifactory_noise/test_artifactory_noise.py New tests for expected artifactory-skip chatter suppression vs explicit noart visibility.
tests/conftest.py Sets repo-local pytest basetemp and centralizes repo-root sys.path insertion.
README.md Documents buildstats/buildtimes and requires_version usage.
mama/utils/system.py Adds active display routing + per-thread capture context + build barrier + subprocess PID reporting.
mama/utils/sub_process.py Adds live-proc tracking, terminate_all/clear_abort, idle timeout, capture propagation, tree kill, and safer output handling.
mama/utils/ssh_multiplex.py Adds always-on SSH safety options and ensures they’re included in option assembly.
mama/utils/run.py Adds quiet passthrough to execute_echo for target.run() command execution.
mama/utils/proc_cpu.py New module for process-tree CPU sampling (psutil + Windows kernel32 implementation).
mama/utils/log_writer.py New async log writer with ANSI stripping and idle-flush behavior.
mama/util.py Adds progress classification helpers, version parsing/comparison, and tweaks time formatting threshold.
mama/types/git.py Adds git noise filtering, progress collapsing, idle-timeout killing for stalled git, and dirty-tree guard.
mama/papa_deploy.py Writes/reads compiler stamp in papa.txt for package mismatch diagnostics.
mama/main.py Adds unified execution path selection, serial/buildtimes usage output, and improved target error messages.
mama/cmake_compiler_cache.py New compiler-detection seed cache for faster cold configures with invalidation/healing.
mama/build_target.py Adds requires_version(), configure/build phase split, TU-based job sizing, and build barrier integration.
mama/build_scheduler.py New scheduler implementing parallel DAG execution with governors, priorities, dynamic growth, and fail-fast.
mama/build_dependency.py Adds thread-safe dep registry and per-dep load lock, load-action labeling, clean shim reload, and targeted-build correctness.
mama/build_config.py Adds new flags (buildtimes, git_timeout, compiler cache disable), compiler lock/warn-once, and MSVC toolset selection helper.
mama/artifactory.py Adds compiler mismatch warning for artifactory packages.
mama/_version.py Bumps version to 0.13.01.
CLAUDE.md Extends documented style rules (cache repeated calculations).
bench/repos.txt Adds repo manifest for config-overhead benchmarking.
bench/bench_config_overhead.py Adds a manual benchmark script to measure cold/seeded/warm CMake configure times.
.gitignore Ignores benchmark artifacts, pytest temp dir, and Claude worktrees.
.claude/skills/mama-style-review/SKILL.md Updates skill guidance around caching repeated computations.

Comment thread mama/build_config.py Outdated
Comment thread mama/utils/system.py Outdated
Comment thread tests/test_sub_process/test_sub_process.py Outdated
Major rework of the mamabuild engine. The build now runs the whole dependency
graph as a parallel DAG - git clones, CMake configures and compilation all overlap
under one scheduler with a live per-target display.

- Parallel DAG scheduler: a dep's configure waits on its children's builds; leaves
  build while deeper deps still clone. Critical-path scheduling, RAM-capped concurrency,
  fail-fast Ctrl+C that kills the whole child tree.
- Cross-build-dir compiler-seed cache: a synthetic C+CXX probe transplants toolchain
  detection into every fresh build dir, cutting cold configures to a fraction. The C++
  stdlib is part of the cache fingerprint.
- Compiler-scoped build dirs (linux vs linux-clang) so gcc and clang trees coexist.
- Self-healing build dirs after an interrupted configure; graceful build-failure reports.
- buildstats: per-package timing bars plus a frontend/backend/link breakdown
  (MSVC vcperf, Clang -ftime-trace).
- Live display, async packages/mamabuild.log, parallel git via SSH multiplexing.
@RedFox20
RedFox20 force-pushed the experimental/multitasked-configure-build branch from f2b7a3e to 2ab4752 Compare July 22, 2026 14:01
@RedFox20
RedFox20 merged commit d7de2da into master Jul 22, 2026
1 check passed
@RedFox20
RedFox20 deleted the experimental/multitasked-configure-build branch July 22, 2026 14:02
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