49 Commits

Author SHA1 Message Date
Ray Molenkamp
7ec48a6ed1 Benchmark: allow exclusion filters using !
This allows exclusions to be set in the `tests` filter for the
benchmarks using the exclamation mark. Exclusions apply *after*
inclusions ie:

tests = ['*', '!victor', '!koro']

would select all available tests then specifically exclude victor
and koro, while:

tests = ['!victor']

would just exclude victor, since nothing is marked for inclusion
no tests will be run.

tests = ['!victor','bmw27,'victor']

would exclude victor, but include bmw27 and victor but as victor was
marked for exclusion only bmw27 will be ran.

Requested by bart in #146019

Pull Request: https://projects.blender.org/blender/blender/pulls/147588
2025-10-09 10:46:25 +02:00
Campbell Barton
705c868bb9 Cleanup: trailing space 2025-09-23 09:37:03 +10:00
Namit Bhutani
8536fd1223 Sculpt: Compress position undo step data
Stored undo step data for position changes in sculpt mode are now
automatically compressed. Compression is run in background threads,
reducing memory consumption during sculpting sessions while adding
little performance overhead.

For testing and benchmarks, memory usage is now available through
`bpy.app.undo_memory_info()`. Undo memory usage is now tracked by the
existing automated benchmark tests. Some changes to the web benchmark
visualization present the data a bit better.

ZSTD compression is run asynchronously in a backround task pool.
Compression is only blocking if the data is requested immediately for
undo/redo.

Co-authored-by: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/141310
2025-09-03 19:15:05 +02:00
Christoph Neuhauser
1e523e2f5d Fix #143653: Add use of Quality of Service (QoS) API on Windows
This PR adds code for setting the Quality of Service (QoS) level of the
process on Windows. This can, e.g., make sure that on hybrid systems
P-cores are utilized even when the app window is out of focus.

In the following cases, it is adjusted from the default behavior:
- In wm_jobs.cc the QoS level is raised while a priority job is running.
- The command line option `--qos [high|eco|default]` can be used to
  change the QoS level of the process.
- By default, the QoS level is raised for the EEVEE performance tests,
  as they check viewport rendering performance and would otherwise be
  reliant on never going out of focus to not get a downgraded QoS level.
  By default, they are created with an out of focus window at the time
  of landing this PR. This PR makes sure that they actually measure the
  animation replay performance attainable during real-world use.

Pull Request: https://projects.blender.org/blender/blender/pulls/144224
2025-09-01 11:19:17 +02:00
Christoph Neuhauser
7c7af11b9b Tests: Turn VSync off for performance tests
To avoid timings being capped at the display refresh rate.

Ref #143049

Pull Request: https://projects.blender.org/blender/blender/pulls/144555
2025-08-14 16:39:29 +02:00
Bastien Montagne
8d04546fb7 Benchmark Tests: improve error reporting.
When a benchmark test was failing, there was very little info available
to investigate it. Now report the stdout/stderr generated by the failing
command.
2025-06-24 18:54:55 +02:00
Alaska
7a47762c20 Benchmark: Enable OSL in Cycles performance benchmark tool
This commit gives users of the Cycles performance benchmark tool the
option to run performance benchmarks with OSL enabled for CPUs
and OptiX devices.

This can be done by adding `-OSL` to the device name:
`CPU-OSL`
`OPTIX-OSL_0`

Pull Request: https://projects.blender.org/blender/blender/pulls/136506
2025-03-26 23:52:14 +01:00
Sergey Sharybin
60ca0742cb Benchmark: Support running benchmark with HW RT enabled
Similar to the regression tests it is possible to append -RT suffix
to the compute type to enable hardware ray-tracing.

For example HIP_0 will run benchmark on first HIP device without
hardware ray-tracing, HIP-RT_0 will run benchmark on the same device
but will enable hardware ray-tracing.

The downside of this change is that it will make it so METAL device
will no longer use HW-RT on M3 and aboce, and explicit METAL-RT is
to be used. This is because benchmark was relying on the Auto
configuration which has different behavior depending on the device
generation.

Pull Request: https://projects.blender.org/blender/blender/pulls/136308
2025-03-24 15:47:42 +01:00
Brecht Van Lommel
9135929063 Tests: Add back missing memory / time title in benchmark html
Pull Request: https://projects.blender.org/blender/blender/pulls/133763
2025-01-29 13:55:29 +01:00
Iliya Katueshenock
f16127a356 Tests: Add scroll to view long benchmark graph legend
Pull Request: https://projects.blender.org/blender/blender/pulls/128339
2025-01-26 08:54:44 +01:00
Iliya Katueshenock
ea7d97ae48 Tests: Avoid error in performance tests with lite build
There is no Cycles add-on in a lite build.

Pull Request: https://projects.blender.org/blender/blender/pulls/120442
2025-01-25 21:12:45 +01:00
Brecht Van Lommel
04298a0c48 Tests: Use tabs in benchmark charts
For easier overview, and to make this heavy page a bit easier to browse.

Pull Request: https://projects.blender.org/blender/blender/pulls/133385
2025-01-21 18:01:42 +01:00
Campbell Barton
abd933d6b0 Cleanup: prefer parenthesis over line continuations in Python scripts 2025-01-21 23:30:55 +11:00
Campbell Barton
a0453ab87a Cleanup: update use of typing in for Python scripts 2024-10-23 12:48:09 +11:00
Brecht Van Lommel
fe4c28f2dc Fix: Benchmarks auto build not working with new lib directories
Symlinking the lib folder doesn't work anymore with submodules.
2024-06-06 19:52:55 +02:00
Sergey Sharybin
396348eea9 Merge branch 'blender-v4.1-release' 2024-02-22 13:51:48 +01:00
Sergey Sharybin
3dc832a904 Switch SVN to Git submodules using Git-LFS
This change makes it so build system and update utilities for Blender builds
are using pre-compiled libraries and other resources attached as Git modules
instead of using checkout of SVN repositories in the parent folder.

The directory layout:
```
  * release/datafiles/
    * assets/        -> blender-assets.git
      * publish/
      * ...
      * README.txt
  * lib/
    * darwin_x64/    -> lib-darwin_x64.git
    * darwin_arm64/  -> lib-darwin_arm64.git
    * linux_x64/     -> lib-linux_x64.git
    * windows_x64/   -> lib-windows_x64.git
  * tests/
    * data/         -> blender-test-data.git
```

The changes about configuring the actual Git sub-modules are not included
into this patch, as those require repository to actually exist before it
can be used.

The assets submodule is enabled by default, and the rest of them are
disabled. This means that if someone runs `git submodule update --init`
they will not get heavy libraries. The platform-specific and tests
related submodules are enabled when using `make update` or `make test`.

All the submodules are tracked: this means that when new commits are
done to the submodule, the blender.git repository is to be updated to
point them to the new hash. This causes some extra manual work, but it
allows to more easily update Blender and its dependencies to known good
state when performing operations like bisect.

Ref #108978

Pull Request: https://projects.blender.org/blender/blender/pulls/117946
2024-02-22 13:50:55 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Brecht Van Lommel
d287f17803 Tests: Tweak benchmarks for automation
* Non-zero exit code when test failed
* Ignore GPU devices for tests that don't use them
* Support config option to only run background mode tests
2024-02-19 09:25:24 +01:00
Brecht Van Lommel
9c8a9662c0 Tests: Cache revision builds in benchmark script
In the mode where the script automatically builds Blender at given git
hashes, cache the builds instead of rebuilding them before running.
2024-01-18 21:28:23 +01:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
89811cb96f Cleanup: unused-imports in tests/ 2023-07-25 21:43:53 +10:00
Sergey Sharybin
4f9a9abcf1 Merge branch 'blender-v3.6-release' 2023-06-15 13:40:38 +02:00
Sergey Sharybin
2d3c9bcee8 Benchmark: Pack python expression into a single line
There should be no functional changes for the typical usecase,
but it allows to have more tricky setups like pointing to a
BAT script to override some configuration.

The issue is that BAT scripts do not support new lines in the
command line arguments. That's where single-line python expression
helps.

For example, it is possible to point benchmark script to a blender.bat
which contains

    blender.exe --python-expr "import bpy; bpy.context.preferences.addons['cycles'].preferences.use_oneapirt = False" %*

to have side-by-side numbers of oneAPI with and without HW RT.

Without this change the %* is which did not work: the BAT
script did not "see" part of the command line past the new line.

Pull Request: https://projects.blender.org/blender/blender/pulls/109006
2023-06-15 13:40:17 +02:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Sergey Sharybin
fc440c4fa0 Fix monster performance benchmark run on Windows
The scene contains some interesting names, which requires to be
written as utf-8. And on Windows file descriptor is not guaranteed
to be using utf-8. Or, will error out if the invalid utf-8 sequence
is written.

This change makes it so running benchmarks on windows it fully successful.

Pull Request: https://projects.blender.org/blender/blender/pulls/108982
2023-06-14 18:11:22 +02:00
Patrick Mours
8a32d56056 Tests: Fix device list of benchmark script only showing a single GPU
Pull Request #104583
2023-02-10 19:38:37 +01:00
Sergey Sharybin
bd6b0bac88 Update references to the new projects platform and main branch 2023-02-07 14:18:19 +01:00
Jacques Lucke
006e905957 Tests: support running benchmark when Blender prints unrelated text
I noticed that sometimes the geometry nodes benchmark would not work
if there were some left-over debug prints in the code. The reason it did
not work was because the prints were mixed with the test output print.
I also tried using explicit flusing and `atexit` for printing the test output,
but that didn't solve it. Just printing additional newlines to better separate
the test output from other printed output helped though.
2023-01-06 13:04:49 +01:00
Brecht Van Lommel
cc12f3e0ba Cleanup: fix various typos
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D15588
2022-08-03 19:28:05 +02:00
Campbell Barton
3035235def Cleanup: run autopep8 on tests/ 2022-04-19 15:25:55 +10:00
Campbell Barton
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Brecht Van Lommel
8ae6995e98 Tests: show more precise numbers in benchmark charts 2022-01-14 15:17:22 +01:00
Brecht Van Lommel
7d5ef64bfb Cleanup: fix typos in comments and docs
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D13264
2021-11-19 12:46:49 +01:00
Brecht Van Lommel
71131b4969 Tests: disable audio system for performance tests 2021-11-12 20:03:46 +01:00
Ray Molenkamp
7c25399576 tests/benchmarks: Fix operation on windows
The test script did not work on windows
since it had some trouble importing the
api module on the blender side of things.

turning the file path to the module into
a raw string literal sidesteps the
backslash issue in the path.

Differential Revision: https://developer.blender.org/D13163

Reviewed by: brecht
2021-11-09 09:58:48 -07:00
Campbell Barton
c516659b5e Cleanup: use static sets 2021-11-08 14:52:08 +11:00
Brecht Van Lommel
335f40ebfa Tests: include device type in benchmark graph labels 2021-10-06 14:21:26 +02:00
Brecht Van Lommel
cc653c9b02 Fix potential render tests error with invalid utf-8 characters
In general should not happen, but better to report the actual error instead
of the Python test code failing.
2021-09-28 20:50:38 +02:00
Brecht Van Lommel
42215d7cb8 Tests: more graceful handling of keyboard interrupting benchmarks
Leave current test result unchanged and stop executing immediately,
so it can be continued.
2021-09-10 16:48:26 +02:00
Brecht Van Lommel
5bfc3a3421 Fix error running benchmark script with environment variables for builds
Ref D12434
2021-09-08 19:58:27 +02:00
Brecht Van Lommel
6fc94d1848 Tests: updates for performance benchmarking
* Make "run" command (re-)run all tests, add "update" command to only
  run queued and outdated tests equivalent to the old "run" command.
* Support specifying environment variables for revisions, to easily
  compare multiple parameter values.
* Better sorting of revisions in graph.
2021-09-08 16:40:58 +02:00
Brecht Van Lommel
214e4aac97 Fix Python error in ./benchmark init after recent changes 2021-08-19 17:45:37 +02:00
Brecht Van Lommel
22b03e1c68 Fix Python error in benchmark executable detection after recent changes 2021-07-26 18:04:40 +02:00
Brecht Van Lommel
320f34af86 Tests: continue running benchmarks if some tests fail to build or run
Convenient when testing many revisions where some might be broken.
2021-07-22 16:35:00 +02:00
Brecht Van Lommel
19b597c55d Tests: improve finding of Blender executables in benchmarking
* Allow specifying a folder and automatically setting the proper executable
  name depending on the operating system
* Use executables from configs for listing devices instead of a blender
  command being available
2021-07-22 16:34:57 +02:00
Brecht Van Lommel
37a5ff4a84 Tests: support graphing peak memory in Cycles performance tests
The general graphing mechanism will create one graph for each output
variable. So it's not limited to time and memory, but that is what the
Cycles tests now output.
2021-07-14 16:12:10 +02:00
Campbell Barton
432bfbf7a3 Cleanup: pep8 2021-07-06 12:05:27 +10:00
Brecht Van Lommel
dc3f46d96b Tests: performance testing framework
These are scripts for benchmarking Blender features on real-world .blend
files. They were originally written for benchmarking Cycles performance, and
were made generic so they can be used for more Blender features.

The benchmarks can be run locally by developers. But the plan is to also run
these as part of continuous integration to track performance over time.

Currently there are tests for Cycles rendering and .blend file loading.

Documentation:
https://wiki.blender.org/wiki/Tools/Tests/Performance

Main features:
* User created configurations to quickly run, re-run and analyze a selected
  subset of tests.
* Supports both benchmarking with existing builds, and automatic building of
  specified git commits, tags and branches.
* Generate HTML page with bar and line graphs from test results.
* Controlled using simple command line tool.
* For writing tests, convenient abstraction to run a Python function in Blender
  with arguments and return value.

Ref T74730

Differential Revision: https://developer.blender.org/D11662
2021-07-05 12:32:32 +02:00