Skip to content

Fix #11620 - Remove fmt for formatting ranges, and std::filesystem::path and PyStatus #11628

Merged
mitchute merged 18 commits into
developfrom
fmt_filesystem
Jun 11, 2026
Merged

Fix #11620 - Remove fmt for formatting ranges, and std::filesystem::path and PyStatus #11628
mitchute merged 18 commits into
developfrom
fmt_filesystem

Conversation

@jmarrec

@jmarrec jmarrec commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Pull request overview

Description of the purpose of this PR

Move formatters for std::filesystem::path and PyStatus to std::formatter.

I used a custom build Clang Tool: https://github.com/jmarrec/EnergyPlus-fmt-clang-refactoring
it detects any fmt::format, EnergyPlus::format, std::format with a fs::path argument chained to .string() or .generic_string() and drops that to just {} or {:g} respectively, with std::format as the function called.

I eliminated all fmt::to_string, fmt::format_int, and also fmt::format except the IOFiles ones.

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@jmarrec jmarrec self-assigned this Jun 8, 2026
@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) labels Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit a108a94

Regression Summary

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 6927abf

Regression Summary

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 4701eff

Regression Summary

@jmarrec jmarrec force-pushed the fmt_filesystem branch 2 times, most recently from 48de45a to 0b5df51 Compare June 8, 2026 21:35
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit dc90772

Regression Summary
  • ESO Small Diffs: 701
  • Table Small Diffs: 391
  • MTR Small Diffs: 519
  • Table String Diffs: 172
  • EIO: 393
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 71
  • Table Big Diffs: 34
  • ERR: 15
  • MTR Big Diffs: 2
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit b91b17b

Regression Summary
  • ESO Small Diffs: 708
  • Table Small Diffs: 393
  • MTR Small Diffs: 525
  • Table String Diffs: 177
  • EIO: 397
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 71
  • Table Big Diffs: 35
  • ERR: 15
  • MTR Big Diffs: 2
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit dc90772

Regression Summary

@jmarrec jmarrec force-pushed the fmt_filesystem branch 2 times, most recently from f35c5f6 to e1b437d Compare June 9, 2026 02:00
@jmarrec jmarrec changed the title Fmt filesystem Fix #11620 - Remove fmt for formatting ranges, and std::filesystem::path and PyStatus Jun 9, 2026
@jmarrec jmarrec marked this pull request as ready for review June 9, 2026 07:12
@jmarrec jmarrec requested a review from mitchute June 9, 2026 07:12

@mitchute mitchute 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 @jmarrec. I'm glad you were able to tackle some of these.

jmarrec added 6 commits June 11, 2026 09:43
…iling return

cf llvm/llvm-project#66466 (comment)

CI test_pull_requests.yml uses macos-14, with XCode 15.4, so that's like around Clang 16 or 17...
u64toa writes digits into the buffer but does NOT null-terminate — it relies on the = {} zero-initialization. So s IS a valid null-terminated string. The bug is that std::format("{}", s) where s is char[129] — on  Apple's libc++ (arm64) the char[N] array type isn't decaying to const char*, it's being matched as a range and outputting all 129 bytes including the null padding.
decent CI has error third_party/milo/dtoa.h:161:14
	‘memmove’ is not a member of ‘std’; did you mean ‘wmemmove’?
@jmarrec

jmarrec commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@mitchute Ok CI is finally clean (I rebased onto develop and pushed again).


Note: gcc-13.3-UnitTestsCoverage-RelWithDebInfo had failed but it was unrelated, probably an out of memory error in GCC

image

https://myoldmopar.github.io/EnergyPlusBuildResults/EnergyPlus-d141f1cd56be8534779134582f95236f03eea72a-x86_64-Linux-Ubuntu-24.04-gcc-13.3-UnitTestsCoverage-RelWithDebInfo.html

@mitchute mitchute 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 @jmarrec. This is a nice step forward.

@mitchute mitchute merged commit 0965c5e into develop Jun 11, 2026
11 checks passed
@mitchute mitchute deleted the fmt_filesystem branch June 11, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Defect Includes code to repair a defect in EnergyPlus Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove fmt for formatting ranges, and std::filesystem::path and PyStatus

3 participants