Skip to content

Conversation

@ConorWilliams
Copy link
Owner

@ConorWilliams ConorWilliams commented Jan 21, 2026

Add benchmark scaffolding (google benchmark)

@ConorWilliams ConorWilliams changed the title [V4] promise [V4] benchmark skeleton Jan 23, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces an initial benchmarking scaffold for libfork v4, alongside minor core/layout assertions and build/CI wiring to support running benchmarks in developer mode.

Changes:

  • Add Google Benchmark target with an initial Fibonacci “serial” benchmark and shared helpers.
  • Introduce libfork_DEV_MODE to gate tests/benchmarks, and update presets/workflows to install benchmark dependencies.
  • Add a version header smoke test and refine internal promise/frame layout types/assertions.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/src/version.cpp Adds a Catch2 test to validate version macros are present and reasonable.
src/core/promise.cxx Refactors promise/frame layout structs and adds layout-related static_asserts.
include/libfork/version.hpp Adds #pragma once to the public version header.
include/libfork/macros.hpp Adds public macros for exception/no-exception builds (LF_TRY, LF_THROW, etc.).
benchmark/src/libfork_benchmark/fib/serial.cpp Adds a baseline serial Fibonacci benchmark.
benchmark/src/libfork_benchmark/fib/fib.hpp Adds shared Fibonacci parameters and a reference implementation.
benchmark/src/libfork_benchmark/common.hpp Adds common benchmark helpers (result checking + exception integration).
benchmark/CMakeLists.txt Defines the benchmark executable, dependencies, and a dry-run test hook.
LICENSE.md Adds MPL 2.0 license text.
CMakeUserPresets.json Adds a user preset workflow for benchmark builds/tests.
CMakePresets.json Enables libfork_DEV_MODE in CI presets and tweaks release flags.
CMakeLists.txt Adds libfork_DEV_MODE option and wires benchmarks/tests behind it; exports macros.hpp.
.github/workflows/macos.yml Installs google-benchmark in CI.
.github/workflows/linux.yml Installs google-benchmark in CI.
.github/workflows/linear.yml Updates checkout action version and minor formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ConorWilliams
Copy link
Owner Author

@copilot please resolve the comments you have made on this PR and suggest any further improvements

Copy link

Copilot AI commented Jan 23, 2026

@ConorWilliams I've opened a new pull request, #49, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits January 23, 2026 22:52
…prove error messages

Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Copy link

Copilot AI commented Jan 23, 2026

@ConorWilliams I've opened a new pull request, #51, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 13 commits January 23, 2026 23:03
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
Co-authored-by: ConorWilliams <47435400+ConorWilliams@users.noreply.github.com>
@ConorWilliams ConorWilliams merged commit 214e6a9 into modules Jan 24, 2026
9 checks passed
ConorWilliams added a commit that referenced this pull request Jan 24, 2026
* mv license

* same checkout version

* move to frame

* casting checks

* cmake for benchmark

* fib

* add benchmark dep

* new benchmark structure

* pragma once on headers

* version test

* better version test

* add src

* strip prefix

* bench preset

* benchmark as a test

* add benchmark test to preset

* move to todo

* use variables

* drop no plt

* rename

* proper fib benchmark

* drop todo

* spell

* macros

* no-except safe

* even better errors

* exception safe

* Resolve review comments: add include guard, fix macro evaluations,
improve error messages

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Complete review comment resolution

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Add CodeQL symlink to .gitignore

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Update .gitignore

* Add Fibonacci serial benchmark with direct return

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Complete: Add Fibonacci serial benchmark with direct return

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Remove CodeQL artifact and update gitignore

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Fix .gitignore formatting

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Remove doxygen-specific bits from macros.hpp

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* Complete removal of doxygen-specific bits

Co-authored-by: ConorWilliams
<47435400+ConorWilliams@users.noreply.github.com>

* undo _codeql shenanigens

* reoder bench naming convention

* shorten

* macros

* prevent loop invariant lifting

* spell

* use do-not opt for basic fib as well
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