codegreen 0.4.5__tar.gz → 0.4.7__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.5/codegreen.egg-info → codegreen-0.4.7}/PKG-INFO +1 -1
- codegreen-0.4.7/benchmark/_workload_gpt2_session_staged.py +49 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/__init__.py +1 -1
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/cli/cli.py +159 -58
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/config.json +32 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/language_runtimes/python/codegreen_runtime.py +411 -75
- {codegreen-0.4.5 → codegreen-0.4.7/codegreen.egg-info}/PKG-INFO +1 -1
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen.egg-info/SOURCES.txt +2 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/pyproject.toml +1 -1
- codegreen-0.4.7/tests/test_report_audit.py +512 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/CMakeLists.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/LICENSE +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/MANIFEST.in +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/README.md +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/__main__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/_workload_gpt2.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/_workload_gpt2_session.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/cg_modes_compare.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/compilers.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/config.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/harness.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/profilers.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/results.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/suites/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/suites/base.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/suites/benchmarksgame.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/suites/dacapo.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/suites/perfopt.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/suites/renaissance.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/validation/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/validation/analysis.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/validation/experiments.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/benchmark/validation/reporting.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/_ts_java.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/builder.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/callgraph.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/dataflow.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/energy_flow.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/features.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/pdg.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/types.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analysis/cfg/visualization.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analyzer/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/analyzer/plot.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/cli/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/cli/entrypoint.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/ast_processor.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/bridge_analyze.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/bridge_instrument.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/config.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/configs/TEMPLATE.json +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/configs/c.json +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/configs/cpp.json +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/configs/java.json +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/configs/javascript.json +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/configs/python.json +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/engine.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/language_configs.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/language_engine.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/language_runtimes/c/codegreen_runtime.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/language_runtimes/cpp/codegreen/runtime.hpp +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/language_runtimes/java/codegreen/runtime/CodeGreenRuntime.java +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/instrumentation/language_runtimes/java/codegreen/runtime/CodeGreenStandaloneRuntime.java +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/utils/__init__.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/utils/binary.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen/utils/platform.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen.egg-info/dependency_links.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen.egg-info/entry_points.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen.egg-info/not-zip-safe +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen.egg-info/requires.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/codegreen.egg-info/top_level.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/requirements.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/setup.cfg +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/setup.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/tests/test_instrumentation.py +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/binarytrees/2.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/helloworld/1.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/knucleotide/1.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/mandelbrot/1-ffi.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/mandelbrot/1-mffi.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/2.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/5.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/8-i.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/nsieve/1.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/3.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/4.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/5-im.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/6-im.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/aligned_indent.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/array.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/comment.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/compound_lit.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/cond.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/enum.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/expr.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/func.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/if_else.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/issue-1568.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/issue-2086.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/issue-4079.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/issue-4117.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/issue-4525.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/label.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/loop.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/no_braces.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/preproc_cond.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/preproc_func.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/string.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/struct.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/switch.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/ternary.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/indent/c/unfinished_comment.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/nvim-treesitter/tests/query/highlights/c/enums-as-constants.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/crates/cli/src/templates/PARSER_NAME.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/crates/cli/src/templates/py-binding.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/crates/generate/src/templates/alloc.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/crates/generate/src/templates/array.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/crates/highlight/include/tree_sitter/highlight.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/crates/tags/include/tree_sitter/tags.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/CMakeLists.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/binding_web/lib/tree-sitter.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/include/tree_sitter/api.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/alloc.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/alloc.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/array.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/atomic.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/clock.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/error_costs.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/get_changed_ranges.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/get_changed_ranges.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/host.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/language.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/language.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/length.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/lexer.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/lexer.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/lib.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/node.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/parser.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/parser.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/point.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/portable/endian.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/query.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/reduce_action.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/reusable_node.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/stack.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/stack.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/subtree.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/subtree.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/tree.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/tree.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/tree_cursor.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/tree_cursor.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/ts_assert.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/unicode/ptypes.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/unicode/umachine.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/unicode/urename.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/unicode/utf.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/unicode/utf16.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/unicode/utf8.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/unicode.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/wasm/stdlib.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/wasm/wasm-stdlib.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/wasm_store.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/lib/src/wasm_store.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/depends_on_column/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/epsilon_external_extra_tokens/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/epsilon_external_tokens/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/external_and_internal_anonymous_tokens/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/external_and_internal_tokens/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/external_extra_tokens/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/external_tokens/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/external_unicode_column_alignment/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/get_col_eof/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/get_col_should_hang_not_crash/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/inverted_external_token/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter/test/fixtures/test_grammars/uses_current_column/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/CMakeLists.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/bindings/c/tree_sitter/tree-sitter-c.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/bindings/python/tree_sitter_c/binding.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/bindings/swift/TreeSitterC/c.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/examples/cluster.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/examples/malloc.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/examples/parser.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/src/parser.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/src/tree_sitter/parser.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/test/highlight/keywords.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-c/test/highlight/names.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/CMakeLists.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/bindings/c/tree-sitter-cpp.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/bindings/python/tree_sitter_cpp/binding.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/bindings/swift/TreeSitterCPP/cpp.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/examples/marker-index.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/src/parser.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/src/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-cpp/src/tree_sitter/parser.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/CMakeLists.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/bindings/c/tree-sitter-java.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/bindings/python/tree_sitter_java/binding.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/bindings/swift/TreeSitterJava/java.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/src/parser.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-java/src/tree_sitter/parser.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/CMakeLists.txt +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/bindings/c/tree-sitter-python.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/bindings/python/tree_sitter_python/binding.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/bindings/swift/TreeSitterPython/python.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/src/parser.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/src/scanner.c +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/third_party/tree-sitter-python/src/tree_sitter/array.h +0 -0
- {codegreen-0.4.5 → codegreen-0.4.7}/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.7" # 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,85 @@ 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
|
+
)
|
|
2676
2680
|
|
|
2677
|
-
|
|
2681
|
+
_meta_started_at = datetime.now(_tz.utc).isoformat(timespec="microseconds")
|
|
2682
|
+
_meta_t0_mono = time.monotonic()
|
|
2683
|
+
try:
|
|
2684
|
+
_meta_hostname = _socket.gethostname()
|
|
2685
|
+
except Exception:
|
|
2686
|
+
_meta_hostname = "unknown"
|
|
2687
|
+
_meta_run_id = _uuid.uuid4().hex[:12]
|
|
2688
|
+
|
|
2689
|
+
def _backend_descriptor() -> Dict[str, Any]:
|
|
2690
|
+
"""Structured backend identity. Open for extension: a new backend type
|
|
2691
|
+
slots in by adding an isinstance branch returning the same shape."""
|
|
2692
|
+
nm = backend.name
|
|
2693
|
+
domains_seen: List[str] = []
|
|
2694
|
+
if isinstance(backend, _NEMBBackend):
|
|
2695
|
+
try:
|
|
2696
|
+
domains_seen = list(backend.get_last_domain_breakdown().keys())
|
|
2697
|
+
except Exception:
|
|
2698
|
+
domains_seen = []
|
|
2699
|
+
driver = "nemb_native"
|
|
2700
|
+
elif "perf" in nm.lower():
|
|
2701
|
+
driver = "perf_rapl"
|
|
2702
|
+
elif "powermetrics" in nm.lower():
|
|
2703
|
+
driver = "powermetrics_ioreport"
|
|
2704
|
+
elif isinstance(backend, _TimeOnlyBackend):
|
|
2705
|
+
driver = "time_only"
|
|
2706
|
+
else:
|
|
2707
|
+
driver = "unknown"
|
|
2708
|
+
return {"name": nm, "driver": driver, "domains_seen": domains_seen}
|
|
2709
|
+
|
|
2710
|
+
def _emit_failure_meta(error_msg: str, **extra) -> str:
|
|
2711
|
+
"""Always include meta on failure paths so log-correlation works."""
|
|
2712
|
+
meta = _build_meta(
|
|
2713
|
+
run_id=_meta_run_id,
|
|
2714
|
+
started_at_iso=_meta_started_at,
|
|
2715
|
+
ended_at_iso=datetime.now(_tz.utc).isoformat(timespec="microseconds"),
|
|
2716
|
+
duration_total_s=time.monotonic() - _meta_t0_mono,
|
|
2717
|
+
hostname=_meta_hostname,
|
|
2718
|
+
session_name=None,
|
|
2719
|
+
measurement_quality="failed",
|
|
2720
|
+
domain_support="none",
|
|
2721
|
+
domains={},
|
|
2722
|
+
record_time_series=False,
|
|
2723
|
+
)
|
|
2724
|
+
payload = {"success": False, "error": error_msg, "meta": meta,
|
|
2725
|
+
"command": command, "backend": _backend_descriptor()}
|
|
2726
|
+
payload.update(extra)
|
|
2727
|
+
return json.dumps(payload, indent=2)
|
|
2728
|
+
|
|
2729
|
+
measurement_pairs: List[tuple] = []
|
|
2730
|
+
warmup_pairs: List[tuple] = []
|
|
2731
|
+
domain_runs: List[Dict[str, float]] = []
|
|
2732
|
+
|
|
2733
|
+
def _collect_run(label: str, idx: int, total: int, into: List[tuple]):
|
|
2678
2734
|
if not json_output:
|
|
2679
2735
|
console.print(f"[dim]{label} {idx+1}/{total}[/dim]")
|
|
2680
2736
|
energy_j, elapsed = backend.measure(command)
|
|
2681
|
-
times.append(elapsed)
|
|
2682
2737
|
if energy_j is not None and energy_j > 0:
|
|
2683
|
-
|
|
2738
|
+
into.append((energy_j, elapsed))
|
|
2684
2739
|
if isinstance(backend, _NEMBBackend):
|
|
2685
|
-
|
|
2686
|
-
if
|
|
2687
|
-
domain_runs.append(
|
|
2740
|
+
d = backend.get_last_domain_breakdown()
|
|
2741
|
+
if d and label == "Run":
|
|
2742
|
+
domain_runs.append(d)
|
|
2743
|
+
else:
|
|
2744
|
+
into.append((None, elapsed))
|
|
2688
2745
|
|
|
2689
2746
|
for i in range(warmup):
|
|
2690
2747
|
if include_warmup:
|
|
2691
2748
|
try:
|
|
2692
|
-
_collect_run("Warmup", i, warmup)
|
|
2749
|
+
_collect_run("Warmup", i, warmup, warmup_pairs)
|
|
2693
2750
|
except RuntimeError as e:
|
|
2694
|
-
if json_output:
|
|
2695
|
-
|
|
2696
|
-
else:
|
|
2697
|
-
console.print(f"[red]Warmup failed: {e}[/red]")
|
|
2751
|
+
if json_output: print(_emit_failure_meta(f"Warmup failed: {e}"))
|
|
2752
|
+
else: console.print(f"[red]Warmup failed: {e}[/red]")
|
|
2698
2753
|
raise typer.Exit(1)
|
|
2699
2754
|
else:
|
|
2700
2755
|
if not json_output:
|
|
@@ -2702,22 +2757,23 @@ def run_command(
|
|
|
2702
2757
|
try:
|
|
2703
2758
|
subprocess.run(command, capture_output=True, timeout=300)
|
|
2704
2759
|
except subprocess.TimeoutExpired:
|
|
2705
|
-
if json_output:
|
|
2706
|
-
|
|
2707
|
-
else:
|
|
2708
|
-
console.print(f"[red]Warmup timed out[/red]")
|
|
2760
|
+
if json_output: print(_emit_failure_meta("Warmup timed out"))
|
|
2761
|
+
else: console.print(f"[red]Warmup timed out[/red]")
|
|
2709
2762
|
raise typer.Exit(1)
|
|
2710
2763
|
|
|
2711
2764
|
for i in range(repeat):
|
|
2712
2765
|
try:
|
|
2713
|
-
_collect_run("Run", i, repeat)
|
|
2766
|
+
_collect_run("Run", i, repeat, measurement_pairs)
|
|
2714
2767
|
except RuntimeError as e:
|
|
2715
|
-
if json_output:
|
|
2716
|
-
|
|
2717
|
-
else:
|
|
2718
|
-
console.print(f"[red]{e}[/red]")
|
|
2768
|
+
if json_output: print(_emit_failure_meta(str(e)))
|
|
2769
|
+
else: console.print(f"[red]{e}[/red]")
|
|
2719
2770
|
raise typer.Exit(1)
|
|
2720
2771
|
|
|
2772
|
+
energy_valid_pairs = [(e, t) for (e, t) in measurement_pairs if e is not None]
|
|
2773
|
+
zero_energy_dropped = len(measurement_pairs) - len(energy_valid_pairs)
|
|
2774
|
+
energies = [e for (e, _) in energy_valid_pairs]
|
|
2775
|
+
times = [t for (_, t) in energy_valid_pairs]
|
|
2776
|
+
|
|
2721
2777
|
if not energies:
|
|
2722
2778
|
msg = f"No energy data collected ({backend.name})"
|
|
2723
2779
|
diag = ""
|
|
@@ -2732,56 +2788,101 @@ def run_command(
|
|
|
2732
2788
|
diag = ". No energy sensor found (need NEMB library, or perf on Linux)"
|
|
2733
2789
|
msg += diag
|
|
2734
2790
|
if json_output:
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2791
|
+
t_only = [t for (_, t) in measurement_pairs]
|
|
2792
|
+
t_mean = sum(t_only) / len(t_only) if t_only else 0
|
|
2793
|
+
print(_emit_failure_meta(msg, duration_s={"mean": t_mean},
|
|
2794
|
+
runs={"attempted": len(measurement_pairs),
|
|
2795
|
+
"energy_valid": 0,
|
|
2796
|
+
"zero_energy_dropped": zero_energy_dropped}))
|
|
2738
2797
|
else:
|
|
2739
2798
|
console.print(f"[red]{msg}[/red]")
|
|
2740
|
-
if
|
|
2741
|
-
t_stats = StatisticalAnalysis.summarize(
|
|
2799
|
+
if measurement_pairs:
|
|
2800
|
+
t_stats = StatisticalAnalysis.summarize([t for (_, t) in measurement_pairs])
|
|
2742
2801
|
console.print(f"[bold]Time:[/bold] {t_stats.mean:.4f} s +/- {t_stats.std:.4f} s")
|
|
2743
2802
|
raise typer.Exit(1)
|
|
2744
2803
|
|
|
2745
2804
|
e_stats = StatisticalAnalysis.summarize(energies)
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2805
|
+
pre_iqr_n = len(energies)
|
|
2806
|
+
surviving = set(range(pre_iqr_n))
|
|
2807
|
+
iqr_outliers_removed = e_stats.outliers_removed
|
|
2808
|
+
times_paired = times
|
|
2809
|
+
t_stats = StatisticalAnalysis.summarize(times_paired)
|
|
2810
|
+
|
|
2811
|
+
avg_domains: Dict[str, float] = {}
|
|
2812
|
+
domain_active_count: Dict[str, int] = {}
|
|
2750
2813
|
if domain_runs:
|
|
2751
|
-
|
|
2752
|
-
for dr in domain_runs:
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
if
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2814
|
+
all_keys: set = set()
|
|
2815
|
+
for dr in domain_runs: all_keys.update(dr.keys())
|
|
2816
|
+
for d in all_keys:
|
|
2817
|
+
vals = [dr.get(d, 0.0) for dr in domain_runs]
|
|
2818
|
+
avg_domains[d] = sum(vals) / len(domain_runs)
|
|
2819
|
+
domain_active_count[d] = sum(1 for v in vals if v > 0)
|
|
2820
|
+
|
|
2821
|
+
per_run_power = [e / t for (e, t) in energy_valid_pairs if t > 0]
|
|
2822
|
+
p_stats = StatisticalAnalysis.summarize(per_run_power) if per_run_power else None
|
|
2761
2823
|
cv = (e_stats.std / e_stats.mean * 100) if e_stats.mean > 0 else 0.0
|
|
2762
|
-
avg_power =
|
|
2824
|
+
avg_power = p_stats.mean if p_stats else 0.0
|
|
2763
2825
|
|
|
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 = {}
|
|
2826
|
+
avg_domains_power: Dict[str, float] = {}
|
|
2768
2827
|
if avg_domains and t_stats.mean > 0:
|
|
2769
2828
|
avg_domains_power = {d: j / t_stats.mean for d, j in avg_domains.items()}
|
|
2770
2829
|
|
|
2830
|
+
budget_exceeded = budget is not None and e_stats.mean > budget
|
|
2831
|
+
|
|
2771
2832
|
if json_output:
|
|
2833
|
+
_meta_ended_at = datetime.now(_tz.utc).isoformat(timespec="microseconds")
|
|
2834
|
+
meta_obj = _build_meta(
|
|
2835
|
+
run_id=_meta_run_id,
|
|
2836
|
+
started_at_iso=_meta_started_at,
|
|
2837
|
+
ended_at_iso=_meta_ended_at,
|
|
2838
|
+
duration_total_s=time.monotonic() - _meta_t0_mono,
|
|
2839
|
+
hostname=_meta_hostname,
|
|
2840
|
+
session_name=None,
|
|
2841
|
+
measurement_quality="ok" if energies else "no_energy",
|
|
2842
|
+
domain_support="full" if avg_domains else ("scalar_only" if energies else "none"),
|
|
2843
|
+
domains=avg_domains,
|
|
2844
|
+
record_time_series=False,
|
|
2845
|
+
extras={"include_warmup": bool(include_warmup), "warmup_runs_configured": warmup},
|
|
2846
|
+
)
|
|
2772
2847
|
out = {
|
|
2773
|
-
"
|
|
2774
|
-
"
|
|
2775
|
-
"
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2848
|
+
"meta": meta_obj,
|
|
2849
|
+
"command": command,
|
|
2850
|
+
"backend": _backend_descriptor(),
|
|
2851
|
+
"runs": {
|
|
2852
|
+
"attempted": len(measurement_pairs),
|
|
2853
|
+
"energy_valid": len(energies),
|
|
2854
|
+
"iqr_outliers_removed": iqr_outliers_removed,
|
|
2855
|
+
"zero_energy_dropped": zero_energy_dropped,
|
|
2856
|
+
"warmup_included_in_stats": bool(include_warmup),
|
|
2857
|
+
"warmup_runs": len(warmup_pairs) if include_warmup else 0,
|
|
2858
|
+
"measurement_runs": repeat,
|
|
2859
|
+
},
|
|
2860
|
+
"energy_j": {
|
|
2861
|
+
"mean": e_stats.mean, "std": e_stats.std, "min": e_stats.min, "max": e_stats.max,
|
|
2862
|
+
"ci95_lower": e_stats.ci95_lower, "ci95_upper": e_stats.ci95_upper,
|
|
2863
|
+
"cv_percent_across_runs": round(cv, 2),
|
|
2864
|
+
},
|
|
2865
|
+
"duration_s": {
|
|
2866
|
+
"mean": t_stats.mean, "std": t_stats.std, "min": t_stats.min, "max": t_stats.max,
|
|
2867
|
+
"outliers_removed": t_stats.outliers_removed,
|
|
2868
|
+
},
|
|
2869
|
+
"power_w": {
|
|
2870
|
+
"mean": (round(p_stats.mean, 4) if p_stats else 0.0),
|
|
2871
|
+
"std": (round(p_stats.std, 4) if p_stats else 0.0),
|
|
2872
|
+
"min": (round(p_stats.min, 4) if p_stats else 0.0),
|
|
2873
|
+
"max": (round(p_stats.max, 4) if p_stats else 0.0),
|
|
2874
|
+
"ci95_lower": (round(p_stats.ci95_lower, 4) if p_stats else 0.0),
|
|
2875
|
+
"ci95_upper": (round(p_stats.ci95_upper, 4) if p_stats else 0.0),
|
|
2876
|
+
"computation": "mean_of_per_run_e_over_t",
|
|
2877
|
+
},
|
|
2779
2878
|
"budget_exceeded": budget_exceeded,
|
|
2780
2879
|
}
|
|
2880
|
+
if budget is not None:
|
|
2881
|
+
out["budget_j"] = budget
|
|
2781
2882
|
if avg_domains:
|
|
2782
2883
|
out["domains"] = {d: round(j, 6) for d, j in sorted(avg_domains.items(), key=lambda x: -x[1])}
|
|
2783
|
-
out["
|
|
2784
|
-
|
|
2884
|
+
out["domains_power_w"] = {d: round(w, 4) for d, w in
|
|
2885
|
+
sorted(avg_domains_power.items(), key=lambda x: -x[1])}
|
|
2785
2886
|
print(json.dumps(out, indent=2))
|
|
2786
2887
|
if budget_exceeded:
|
|
2787
2888
|
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,
|