codegreen 0.4.6__tar.gz → 0.4.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codegreen-0.4.6/codegreen.egg-info → codegreen-0.4.8}/PKG-INFO +1 -1
- codegreen-0.4.8/benchmark/_workload_gpt2_session_staged.py +49 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/__init__.py +1 -1
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/cli/cli.py +166 -58
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/config.json +32 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/language_runtimes/python/codegreen_runtime.py +435 -75
- {codegreen-0.4.6 → codegreen-0.4.8/codegreen.egg-info}/PKG-INFO +1 -1
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen.egg-info/SOURCES.txt +2 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/pyproject.toml +1 -1
- codegreen-0.4.8/tests/test_report_audit.py +567 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/CMakeLists.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/LICENSE +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/MANIFEST.in +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/README.md +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/__main__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/_workload_gpt2.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/_workload_gpt2_session.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/cg_modes_compare.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/compilers.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/config.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/harness.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/profilers.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/results.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/suites/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/suites/base.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/suites/benchmarksgame.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/suites/dacapo.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/suites/perfopt.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/suites/renaissance.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/validation/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/validation/analysis.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/validation/experiments.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/benchmark/validation/reporting.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/_ts_java.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/builder.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/callgraph.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/dataflow.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/energy_flow.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/features.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/pdg.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/types.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analysis/cfg/visualization.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analyzer/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/analyzer/plot.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/cli/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/cli/entrypoint.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/ast_processor.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/bridge_analyze.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/bridge_instrument.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/config.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/configs/TEMPLATE.json +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/configs/c.json +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/configs/cpp.json +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/configs/java.json +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/configs/javascript.json +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/configs/python.json +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/engine.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/language_configs.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/language_engine.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/language_runtimes/c/codegreen_runtime.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/language_runtimes/cpp/codegreen/runtime.hpp +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/language_runtimes/java/codegreen/runtime/CodeGreenRuntime.java +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/instrumentation/language_runtimes/java/codegreen/runtime/CodeGreenStandaloneRuntime.java +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/utils/__init__.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/utils/binary.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen/utils/platform.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen.egg-info/dependency_links.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen.egg-info/entry_points.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen.egg-info/not-zip-safe +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen.egg-info/requires.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/codegreen.egg-info/top_level.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/requirements.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/setup.cfg +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/setup.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/tests/test_instrumentation.py +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/binarytrees/2.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/helloworld/1.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/knucleotide/1.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/mandelbrot/1-ffi.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/mandelbrot/1-mffi.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/2.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/5.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/8-i.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/nsieve/1.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/3.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/4.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/5-im.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/6-im.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/aligned_indent.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/array.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/comment.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/compound_lit.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/cond.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/enum.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/expr.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/func.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/if_else.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/issue-1568.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/issue-2086.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/issue-4079.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/issue-4117.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/issue-4525.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/label.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/loop.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/no_braces.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/preproc_cond.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/preproc_func.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/string.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/struct.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/switch.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/ternary.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/indent/c/unfinished_comment.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/nvim-treesitter/tests/query/highlights/c/enums-as-constants.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/crates/cli/src/templates/PARSER_NAME.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/crates/cli/src/templates/py-binding.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/crates/generate/src/templates/alloc.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/crates/generate/src/templates/array.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/crates/highlight/include/tree_sitter/highlight.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/crates/tags/include/tree_sitter/tags.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/CMakeLists.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/binding_web/lib/tree-sitter.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/include/tree_sitter/api.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/alloc.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/alloc.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/array.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/atomic.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/clock.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/error_costs.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/get_changed_ranges.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/get_changed_ranges.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/host.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/language.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/language.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/length.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/lexer.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/lexer.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/lib.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/node.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/parser.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/parser.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/point.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/portable/endian.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/query.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/reduce_action.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/reusable_node.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/stack.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/stack.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/subtree.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/subtree.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/tree.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/tree.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/tree_cursor.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/tree_cursor.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/ts_assert.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/unicode/ptypes.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/unicode/umachine.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/unicode/urename.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/unicode/utf.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/unicode/utf16.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/unicode/utf8.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/unicode.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/wasm/stdlib.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/wasm/wasm-stdlib.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/wasm_store.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/lib/src/wasm_store.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/depends_on_column/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/epsilon_external_extra_tokens/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/epsilon_external_tokens/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/external_and_internal_anonymous_tokens/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/external_and_internal_tokens/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/external_extra_tokens/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/external_tokens/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/external_unicode_column_alignment/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/get_col_eof/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/get_col_should_hang_not_crash/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/inverted_external_token/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter/test/fixtures/test_grammars/uses_current_column/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/CMakeLists.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/bindings/c/tree_sitter/tree-sitter-c.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/bindings/python/tree_sitter_c/binding.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/bindings/swift/TreeSitterC/c.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/examples/cluster.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/examples/malloc.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/examples/parser.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/src/parser.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/src/tree_sitter/parser.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/test/highlight/keywords.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-c/test/highlight/names.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/CMakeLists.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/bindings/c/tree-sitter-cpp.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/bindings/python/tree_sitter_cpp/binding.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/bindings/swift/TreeSitterCPP/cpp.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/examples/marker-index.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/src/parser.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/src/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-cpp/src/tree_sitter/parser.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/CMakeLists.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/bindings/c/tree-sitter-java.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/bindings/python/tree_sitter_java/binding.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/bindings/swift/TreeSitterJava/java.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/src/parser.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-java/src/tree_sitter/parser.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/CMakeLists.txt +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/bindings/c/tree-sitter-python.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/bindings/python/tree_sitter_python/binding.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/bindings/swift/TreeSitterPython/python.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/src/parser.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/src/scanner.c +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.6 → codegreen-0.4.8}/third_party/tree-sitter-python/src/tree_sitter/parser.h +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""GPT2 inference broken into three explicit codegreen tasks (preprocess/train/eval),
|
|
2
|
+
with record_time_series=True so per-task power traces are captured.
|
|
3
|
+
|
|
4
|
+
Differs from _workload_gpt2_session.py (which uses a single "everything" task):
|
|
5
|
+
this script exercises multi-task aggregation, per-task energy/power/duration,
|
|
6
|
+
the inclusive-of-children timeseries semantic, and the noise/quality summary.
|
|
7
|
+
Useful as a smoke-test that the v0.4.7 schema reports stay self-consistent on
|
|
8
|
+
a real ML workload."""
|
|
9
|
+
import os
|
|
10
|
+
import time
|
|
11
|
+
|
|
12
|
+
os.environ.setdefault("TRANSFORMERS_VERBOSITY", "error")
|
|
13
|
+
|
|
14
|
+
import codegreen
|
|
15
|
+
|
|
16
|
+
s = codegreen.Session("pipeline", record_time_series=True).start()
|
|
17
|
+
|
|
18
|
+
s.start_task("preprocess")
|
|
19
|
+
import torch
|
|
20
|
+
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
|
21
|
+
|
|
22
|
+
PROMPTS = [
|
|
23
|
+
"Energy-aware computing is",
|
|
24
|
+
"The cheapest way to train a model is",
|
|
25
|
+
"Hardware energy counters report",
|
|
26
|
+
"Modern transformers can be optimized by",
|
|
27
|
+
] * 8
|
|
28
|
+
|
|
29
|
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
30
|
+
tok = GPT2Tokenizer.from_pretrained("gpt2")
|
|
31
|
+
tok.pad_token = tok.eos_token
|
|
32
|
+
tok.padding_side = "left"
|
|
33
|
+
s.stop_task("preprocess")
|
|
34
|
+
|
|
35
|
+
s.start_task("train")
|
|
36
|
+
model = GPT2LMHeadModel.from_pretrained("gpt2").to(device).eval()
|
|
37
|
+
s.stop_task("train")
|
|
38
|
+
|
|
39
|
+
s.start_task("eval")
|
|
40
|
+
batch = tok(PROMPTS, padding=True, return_tensors="pt").to(device)
|
|
41
|
+
t0 = time.perf_counter()
|
|
42
|
+
with torch.no_grad():
|
|
43
|
+
out = model.generate(**batch, max_new_tokens=128, do_sample=False)
|
|
44
|
+
dt = time.perf_counter() - t0
|
|
45
|
+
print(f"workload done: device={device} prompts={len(PROMPTS)} gen_s={dt:.2f}")
|
|
46
|
+
s.stop_task("eval")
|
|
47
|
+
|
|
48
|
+
s.export_plot(os.environ.get("CG_PLOT", "pipeline.html"))
|
|
49
|
+
report = s.stop()
|
|
@@ -12,7 +12,7 @@ try:
|
|
|
12
12
|
from importlib.metadata import version as _pkg_version
|
|
13
13
|
__version__ = _pkg_version("codegreen")
|
|
14
14
|
except Exception:
|
|
15
|
-
__version__ = "0.4.
|
|
15
|
+
__version__ = "0.4.8" # fallback for dev/editable installs
|
|
16
16
|
__author__ = "Saurabhsingh Rajput"
|
|
17
17
|
__email__ = "saurabh@dal.ca"
|
|
18
18
|
__description__ = "Know the true energy cost of your code"
|
|
@@ -25,7 +25,7 @@ import tempfile
|
|
|
25
25
|
from pathlib import Path
|
|
26
26
|
from typing import Optional, List, Dict, Any, Annotated, Union
|
|
27
27
|
from enum import Enum
|
|
28
|
-
from datetime import datetime
|
|
28
|
+
from datetime import datetime, timezone
|
|
29
29
|
|
|
30
30
|
try:
|
|
31
31
|
import psutil
|
|
@@ -644,7 +644,7 @@ def generate_optimized_config(
|
|
|
644
644
|
# Add initialization metadata
|
|
645
645
|
config["initialization"] = {
|
|
646
646
|
"completed": True,
|
|
647
|
-
"timestamp": datetime.now().isoformat(),
|
|
647
|
+
"timestamp": datetime.now(timezone.utc).isoformat(timespec="microseconds"),
|
|
648
648
|
"environment_type": environment_info["type"],
|
|
649
649
|
"detected_sensors": list(sensor_info.keys()),
|
|
650
650
|
"version": _VERSION
|
|
@@ -1382,7 +1382,7 @@ def _save_measurement_results(
|
|
|
1382
1382
|
"""Save combined analysis and measurement results"""
|
|
1383
1383
|
|
|
1384
1384
|
results = {
|
|
1385
|
-
'timestamp': datetime.now().isoformat(),
|
|
1385
|
+
'timestamp': datetime.now(timezone.utc).isoformat(timespec="microseconds"),
|
|
1386
1386
|
'analysis': {
|
|
1387
1387
|
'language': analysis_result.language,
|
|
1388
1388
|
'success': analysis_result.success,
|
|
@@ -1555,7 +1555,7 @@ def analyze_code_structure(
|
|
|
1555
1555
|
|
|
1556
1556
|
# Output JSON results if requested or save to file
|
|
1557
1557
|
analysis_data = {
|
|
1558
|
-
'timestamp': datetime.now().isoformat(),
|
|
1558
|
+
'timestamp': datetime.now(timezone.utc).isoformat(timespec="microseconds"),
|
|
1559
1559
|
'script': str(script),
|
|
1560
1560
|
'language': result.language,
|
|
1561
1561
|
'success': True,
|
|
@@ -2671,30 +2671,89 @@ def run_command(
|
|
|
2671
2671
|
console.print(f"[red]{stderr[:500]}[/red]")
|
|
2672
2672
|
raise typer.Exit(1)
|
|
2673
2673
|
|
|
2674
|
-
|
|
2675
|
-
|
|
2674
|
+
import socket as _socket
|
|
2675
|
+
import uuid as _uuid
|
|
2676
|
+
from datetime import timezone as _tz
|
|
2677
|
+
from codegreen.instrumentation.language_runtimes.python.codegreen_runtime import (
|
|
2678
|
+
build_meta_block as _build_meta,
|
|
2679
|
+
_iso_local_now,
|
|
2680
|
+
)
|
|
2676
2681
|
|
|
2677
|
-
|
|
2682
|
+
_meta_started_at = datetime.now(_tz.utc).isoformat(timespec="microseconds")
|
|
2683
|
+
_meta_started_at_local = _iso_local_now()
|
|
2684
|
+
_meta_t0_mono = time.monotonic()
|
|
2685
|
+
try:
|
|
2686
|
+
_meta_hostname = _socket.gethostname()
|
|
2687
|
+
except Exception:
|
|
2688
|
+
_meta_hostname = "unknown"
|
|
2689
|
+
_meta_run_id = _uuid.uuid4().hex[:12]
|
|
2690
|
+
|
|
2691
|
+
def _backend_descriptor() -> Dict[str, Any]:
|
|
2692
|
+
"""Structured backend identity. Open for extension: a new backend type
|
|
2693
|
+
slots in by adding an isinstance branch returning the same shape."""
|
|
2694
|
+
nm = backend.name
|
|
2695
|
+
domains_seen: List[str] = []
|
|
2696
|
+
if isinstance(backend, _NEMBBackend):
|
|
2697
|
+
try:
|
|
2698
|
+
domains_seen = list(backend.get_last_domain_breakdown().keys())
|
|
2699
|
+
except Exception:
|
|
2700
|
+
domains_seen = []
|
|
2701
|
+
driver = "nemb_native"
|
|
2702
|
+
elif "perf" in nm.lower():
|
|
2703
|
+
driver = "perf_rapl"
|
|
2704
|
+
elif "powermetrics" in nm.lower():
|
|
2705
|
+
driver = "powermetrics_ioreport"
|
|
2706
|
+
elif isinstance(backend, _TimeOnlyBackend):
|
|
2707
|
+
driver = "time_only"
|
|
2708
|
+
else:
|
|
2709
|
+
driver = "unknown"
|
|
2710
|
+
return {"name": nm, "driver": driver, "domains_seen": domains_seen}
|
|
2711
|
+
|
|
2712
|
+
def _emit_failure_meta(error_msg: str, **extra) -> str:
|
|
2713
|
+
"""Always include meta on failure paths so log-correlation works."""
|
|
2714
|
+
meta = _build_meta(
|
|
2715
|
+
run_id=_meta_run_id,
|
|
2716
|
+
started_at_iso=_meta_started_at,
|
|
2717
|
+
ended_at_iso=datetime.now(_tz.utc).isoformat(timespec="microseconds"),
|
|
2718
|
+
started_at_local_iso=_meta_started_at_local,
|
|
2719
|
+
ended_at_local_iso=_iso_local_now(),
|
|
2720
|
+
duration_total_s=time.monotonic() - _meta_t0_mono,
|
|
2721
|
+
hostname=_meta_hostname,
|
|
2722
|
+
session_name=None,
|
|
2723
|
+
measurement_quality="failed",
|
|
2724
|
+
domain_support="none",
|
|
2725
|
+
domains={},
|
|
2726
|
+
record_time_series=False,
|
|
2727
|
+
)
|
|
2728
|
+
payload = {"success": False, "error": error_msg, "meta": meta,
|
|
2729
|
+
"command": command, "backend": _backend_descriptor()}
|
|
2730
|
+
payload.update(extra)
|
|
2731
|
+
return json.dumps(payload, indent=2)
|
|
2732
|
+
|
|
2733
|
+
measurement_pairs: List[tuple] = []
|
|
2734
|
+
warmup_pairs: List[tuple] = []
|
|
2735
|
+
domain_runs: List[Dict[str, float]] = []
|
|
2736
|
+
|
|
2737
|
+
def _collect_run(label: str, idx: int, total: int, into: List[tuple]):
|
|
2678
2738
|
if not json_output:
|
|
2679
2739
|
console.print(f"[dim]{label} {idx+1}/{total}[/dim]")
|
|
2680
2740
|
energy_j, elapsed = backend.measure(command)
|
|
2681
|
-
times.append(elapsed)
|
|
2682
2741
|
if energy_j is not None and energy_j > 0:
|
|
2683
|
-
|
|
2742
|
+
into.append((energy_j, elapsed))
|
|
2684
2743
|
if isinstance(backend, _NEMBBackend):
|
|
2685
|
-
|
|
2686
|
-
if
|
|
2687
|
-
domain_runs.append(
|
|
2744
|
+
d = backend.get_last_domain_breakdown()
|
|
2745
|
+
if d and label == "Run":
|
|
2746
|
+
domain_runs.append(d)
|
|
2747
|
+
else:
|
|
2748
|
+
into.append((None, elapsed))
|
|
2688
2749
|
|
|
2689
2750
|
for i in range(warmup):
|
|
2690
2751
|
if include_warmup:
|
|
2691
2752
|
try:
|
|
2692
|
-
_collect_run("Warmup", i, warmup)
|
|
2753
|
+
_collect_run("Warmup", i, warmup, warmup_pairs)
|
|
2693
2754
|
except RuntimeError as e:
|
|
2694
|
-
if json_output:
|
|
2695
|
-
|
|
2696
|
-
else:
|
|
2697
|
-
console.print(f"[red]Warmup failed: {e}[/red]")
|
|
2755
|
+
if json_output: print(_emit_failure_meta(f"Warmup failed: {e}"))
|
|
2756
|
+
else: console.print(f"[red]Warmup failed: {e}[/red]")
|
|
2698
2757
|
raise typer.Exit(1)
|
|
2699
2758
|
else:
|
|
2700
2759
|
if not json_output:
|
|
@@ -2702,22 +2761,23 @@ def run_command(
|
|
|
2702
2761
|
try:
|
|
2703
2762
|
subprocess.run(command, capture_output=True, timeout=300)
|
|
2704
2763
|
except subprocess.TimeoutExpired:
|
|
2705
|
-
if json_output:
|
|
2706
|
-
|
|
2707
|
-
else:
|
|
2708
|
-
console.print(f"[red]Warmup timed out[/red]")
|
|
2764
|
+
if json_output: print(_emit_failure_meta("Warmup timed out"))
|
|
2765
|
+
else: console.print(f"[red]Warmup timed out[/red]")
|
|
2709
2766
|
raise typer.Exit(1)
|
|
2710
2767
|
|
|
2711
2768
|
for i in range(repeat):
|
|
2712
2769
|
try:
|
|
2713
|
-
_collect_run("Run", i, repeat)
|
|
2770
|
+
_collect_run("Run", i, repeat, measurement_pairs)
|
|
2714
2771
|
except RuntimeError as e:
|
|
2715
|
-
if json_output:
|
|
2716
|
-
|
|
2717
|
-
else:
|
|
2718
|
-
console.print(f"[red]{e}[/red]")
|
|
2772
|
+
if json_output: print(_emit_failure_meta(str(e)))
|
|
2773
|
+
else: console.print(f"[red]{e}[/red]")
|
|
2719
2774
|
raise typer.Exit(1)
|
|
2720
2775
|
|
|
2776
|
+
energy_valid_pairs = [(e, t) for (e, t) in measurement_pairs if e is not None]
|
|
2777
|
+
zero_energy_dropped = len(measurement_pairs) - len(energy_valid_pairs)
|
|
2778
|
+
energies = [e for (e, _) in energy_valid_pairs]
|
|
2779
|
+
times = [t for (_, t) in energy_valid_pairs]
|
|
2780
|
+
|
|
2721
2781
|
if not energies:
|
|
2722
2782
|
msg = f"No energy data collected ({backend.name})"
|
|
2723
2783
|
diag = ""
|
|
@@ -2732,56 +2792,104 @@ def run_command(
|
|
|
2732
2792
|
diag = ". No energy sensor found (need NEMB library, or perf on Linux)"
|
|
2733
2793
|
msg += diag
|
|
2734
2794
|
if json_output:
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2795
|
+
t_only = [t for (_, t) in measurement_pairs]
|
|
2796
|
+
t_mean = sum(t_only) / len(t_only) if t_only else 0
|
|
2797
|
+
print(_emit_failure_meta(msg, duration_s={"mean": t_mean},
|
|
2798
|
+
runs={"attempted": len(measurement_pairs),
|
|
2799
|
+
"energy_valid": 0,
|
|
2800
|
+
"zero_energy_dropped": zero_energy_dropped}))
|
|
2738
2801
|
else:
|
|
2739
2802
|
console.print(f"[red]{msg}[/red]")
|
|
2740
|
-
if
|
|
2741
|
-
t_stats = StatisticalAnalysis.summarize(
|
|
2803
|
+
if measurement_pairs:
|
|
2804
|
+
t_stats = StatisticalAnalysis.summarize([t for (_, t) in measurement_pairs])
|
|
2742
2805
|
console.print(f"[bold]Time:[/bold] {t_stats.mean:.4f} s +/- {t_stats.std:.4f} s")
|
|
2743
2806
|
raise typer.Exit(1)
|
|
2744
2807
|
|
|
2745
2808
|
e_stats = StatisticalAnalysis.summarize(energies)
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2809
|
+
pre_iqr_n = len(energies)
|
|
2810
|
+
surviving = set(range(pre_iqr_n))
|
|
2811
|
+
iqr_outliers_removed = e_stats.outliers_removed
|
|
2812
|
+
times_paired = times
|
|
2813
|
+
t_stats = StatisticalAnalysis.summarize(times_paired)
|
|
2814
|
+
|
|
2815
|
+
avg_domains: Dict[str, float] = {}
|
|
2816
|
+
domain_active_count: Dict[str, int] = {}
|
|
2750
2817
|
if domain_runs:
|
|
2751
|
-
|
|
2752
|
-
for dr in domain_runs:
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
if
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2818
|
+
all_keys: set = set()
|
|
2819
|
+
for dr in domain_runs: all_keys.update(dr.keys())
|
|
2820
|
+
for d in all_keys:
|
|
2821
|
+
vals = [dr.get(d, 0.0) for dr in domain_runs]
|
|
2822
|
+
avg_domains[d] = sum(vals) / len(domain_runs)
|
|
2823
|
+
domain_active_count[d] = sum(1 for v in vals if v > 0)
|
|
2824
|
+
|
|
2825
|
+
per_run_power = [e / t for (e, t) in energy_valid_pairs if t > 0]
|
|
2826
|
+
p_stats = StatisticalAnalysis.summarize(per_run_power) if per_run_power else None
|
|
2761
2827
|
cv = (e_stats.std / e_stats.mean * 100) if e_stats.mean > 0 else 0.0
|
|
2762
|
-
avg_power =
|
|
2828
|
+
avg_power = p_stats.mean if p_stats else 0.0
|
|
2763
2829
|
|
|
2764
|
-
|
|
2765
|
-
# scalar `power_watts` so the two are comparable (sum of domain powers
|
|
2766
|
-
# equals total power up to RAPL's overlapping-domain accounting).
|
|
2767
|
-
avg_domains_power = {}
|
|
2830
|
+
avg_domains_power: Dict[str, float] = {}
|
|
2768
2831
|
if avg_domains and t_stats.mean > 0:
|
|
2769
2832
|
avg_domains_power = {d: j / t_stats.mean for d, j in avg_domains.items()}
|
|
2770
2833
|
|
|
2834
|
+
budget_exceeded = budget is not None and e_stats.mean > budget
|
|
2835
|
+
|
|
2771
2836
|
if json_output:
|
|
2837
|
+
_meta_ended_at = datetime.now(_tz.utc).isoformat(timespec="microseconds")
|
|
2838
|
+
_meta_ended_at_local = _iso_local_now()
|
|
2839
|
+
meta_obj = _build_meta(
|
|
2840
|
+
run_id=_meta_run_id,
|
|
2841
|
+
started_at_iso=_meta_started_at,
|
|
2842
|
+
ended_at_iso=_meta_ended_at,
|
|
2843
|
+
started_at_local_iso=_meta_started_at_local,
|
|
2844
|
+
ended_at_local_iso=_meta_ended_at_local,
|
|
2845
|
+
duration_total_s=time.monotonic() - _meta_t0_mono,
|
|
2846
|
+
hostname=_meta_hostname,
|
|
2847
|
+
session_name=None,
|
|
2848
|
+
measurement_quality="ok" if energies else "no_energy",
|
|
2849
|
+
domain_support="full" if avg_domains else ("scalar_only" if energies else "none"),
|
|
2850
|
+
domains=avg_domains,
|
|
2851
|
+
record_time_series=False,
|
|
2852
|
+
extras={"include_warmup": bool(include_warmup), "warmup_runs_configured": warmup},
|
|
2853
|
+
)
|
|
2772
2854
|
out = {
|
|
2773
|
-
"
|
|
2774
|
-
"
|
|
2775
|
-
"
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2855
|
+
"meta": meta_obj,
|
|
2856
|
+
"command": command,
|
|
2857
|
+
"backend": _backend_descriptor(),
|
|
2858
|
+
"runs": {
|
|
2859
|
+
"attempted": len(measurement_pairs),
|
|
2860
|
+
"energy_valid": len(energies),
|
|
2861
|
+
"iqr_outliers_removed": iqr_outliers_removed,
|
|
2862
|
+
"zero_energy_dropped": zero_energy_dropped,
|
|
2863
|
+
"warmup_included_in_stats": bool(include_warmup),
|
|
2864
|
+
"warmup_runs": len(warmup_pairs) if include_warmup else 0,
|
|
2865
|
+
"measurement_runs": repeat,
|
|
2866
|
+
},
|
|
2867
|
+
"energy_j": {
|
|
2868
|
+
"mean": e_stats.mean, "std": e_stats.std, "min": e_stats.min, "max": e_stats.max,
|
|
2869
|
+
"ci95_lower": e_stats.ci95_lower, "ci95_upper": e_stats.ci95_upper,
|
|
2870
|
+
"cv_percent_across_runs": round(cv, 2),
|
|
2871
|
+
},
|
|
2872
|
+
"duration_s": {
|
|
2873
|
+
"mean": t_stats.mean, "std": t_stats.std, "min": t_stats.min, "max": t_stats.max,
|
|
2874
|
+
"outliers_removed": t_stats.outliers_removed,
|
|
2875
|
+
},
|
|
2876
|
+
"power_w": {
|
|
2877
|
+
"mean": (round(p_stats.mean, 4) if p_stats else 0.0),
|
|
2878
|
+
"std": (round(p_stats.std, 4) if p_stats else 0.0),
|
|
2879
|
+
"min": (round(p_stats.min, 4) if p_stats else 0.0),
|
|
2880
|
+
"max": (round(p_stats.max, 4) if p_stats else 0.0),
|
|
2881
|
+
"ci95_lower": (round(p_stats.ci95_lower, 4) if p_stats else 0.0),
|
|
2882
|
+
"ci95_upper": (round(p_stats.ci95_upper, 4) if p_stats else 0.0),
|
|
2883
|
+
"computation": "mean_of_per_run_e_over_t",
|
|
2884
|
+
},
|
|
2779
2885
|
"budget_exceeded": budget_exceeded,
|
|
2780
2886
|
}
|
|
2887
|
+
if budget is not None:
|
|
2888
|
+
out["budget_j"] = budget
|
|
2781
2889
|
if avg_domains:
|
|
2782
2890
|
out["domains"] = {d: round(j, 6) for d, j in sorted(avg_domains.items(), key=lambda x: -x[1])}
|
|
2783
|
-
out["
|
|
2784
|
-
|
|
2891
|
+
out["domains_power_w"] = {d: round(w, 4) for d, w in
|
|
2892
|
+
sorted(avg_domains_power.items(), key=lambda x: -x[1])}
|
|
2785
2893
|
print(json.dumps(out, indent=2))
|
|
2786
2894
|
if budget_exceeded:
|
|
2787
2895
|
raise typer.Exit(1)
|
|
@@ -66,6 +66,19 @@
|
|
|
66
66
|
"statistical_validation": true,
|
|
67
67
|
"confidence_threshold": 0.95
|
|
68
68
|
}
|
|
69
|
+
},
|
|
70
|
+
"report": {
|
|
71
|
+
"schema_version": "1",
|
|
72
|
+
"iso_timestamp_format": "rfc3339_utc",
|
|
73
|
+
"run_id_bytes": 6,
|
|
74
|
+
"outlier_method": "iqr_1.5",
|
|
75
|
+
"noise_warning": {
|
|
76
|
+
"within_task_power_cv_pct_threshold": 10.0,
|
|
77
|
+
"sampling_drop_ratio_threshold": 0.20,
|
|
78
|
+
"quality_excellent_below_cv_pct": 2.0,
|
|
79
|
+
"quality_good_below_cv_pct": 5.0,
|
|
80
|
+
"quality_moderate_below_cv_pct": 10.0
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
},
|
|
71
84
|
"instrumentation": {
|
|
@@ -153,6 +166,25 @@
|
|
|
153
166
|
]
|
|
154
167
|
}
|
|
155
168
|
},
|
|
169
|
+
"hotspot_taxonomy": {
|
|
170
|
+
"_comment": "Per-verdict thresholds for `codegreen project`'s per-function classifier. OCP-compliant: each verdict is a self-contained block; new verdicts can be added without touching dispatch code. Defaults match the historical hardcoded thresholds at codegreen/cli/cli.py:3424-3435 prior to extraction. CodeGreen detects wrapper / TYPE_1_DIRECT / TYPE_2_INEFFICIENT / TYPE_5_FREQUENCY / minor; TYPE_3_INDIRECT and TYPE_4_STRUCTURAL require callgraph analysis and are deferred to the consuming agent.",
|
|
171
|
+
"wrapper": {
|
|
172
|
+
"self_ratio_max": 0.2,
|
|
173
|
+
"inclusive_pct_min": 5.0
|
|
174
|
+
},
|
|
175
|
+
"TYPE_1_DIRECT": {
|
|
176
|
+
"exclusive_pct_min": 10.0
|
|
177
|
+
},
|
|
178
|
+
"TYPE_2_INEFFICIENT": {
|
|
179
|
+
"exclusive_pct_min": 5.0,
|
|
180
|
+
"efficiency_ratio_min": 3.0
|
|
181
|
+
},
|
|
182
|
+
"TYPE_5_FREQUENCY": {
|
|
183
|
+
"calls_min": 100000,
|
|
184
|
+
"exclusive_pct_min": 3.0,
|
|
185
|
+
"efficiency_ratio_max": 1.5
|
|
186
|
+
}
|
|
187
|
+
},
|
|
156
188
|
"developer": {
|
|
157
189
|
"debug_mode": false,
|
|
158
190
|
"verbose_logging": false,
|