Add rev11 profiler harness, focused rev14 aggregation optimization, and statistical validator#11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e126006b0e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| off_axis_summary=summarize_rows(tbl,off_axis_rows,wall_runtime_s); | ||
|
|
||
| % Aggregation path proxy: db2pow/pow2db/sum/max inside rev11 aggregation loop. | ||
| agg_parts={'db2pow','pow2db','sum','max'}; |
There was a problem hiding this comment.
Restrict aggregation proxy pattern matching
The aggregation proxy is built from substring matches and includes 'max', so match_rows will also capture unrelated functions like subchunk_agg_check_maxazi_rev11 (and any other name containing max). This inflates agg_summary.total_time_s and can bias recommended_target toward aggregation even when another helper is the true hotspot, which defeats the profiler harness’s goal of identifying the dominant bottleneck.
Useful? React with 👍 / 👎.
|
|
||
| % Focused optimization input for STEP 4: | ||
| % convert off-axis gain once to multiplicative mW-domain factor. | ||
| off_axis_gain_linear=db2pow(off_axis_gain_matrix); |
There was a problem hiding this comment.
Avoid doubling full off-axis matrix memory footprint
This line materializes a second full num_bs x num_sim_azi array while off_axis_gain_matrix is still live, which doubles peak memory before Monte Carlo aggregation begins. On large scenarios (the same ones chunking is meant to support), that extra allocation can trigger out-of-memory failures and abort runs; converting per chunk or freeing the original matrix before continuing would avoid this regression.
Useful? React with 👍 / 👎.
Motivation
subchunk_agg_check_maxazi_rev11and enable a single-surface optimization pass.Description
profile_subchunk_agg_check_maxazi_rev11_real.m, a MATLAB profiling harness that runssubchunk_agg_check_maxazi_rev11on exact real inputs, summarizes top contributors by total/self time, reports explicit timings for key helpers (monte_carlo_Pr_dBm_rev2_app,monte_carlo_super_bs_eirp_dist_rev5,monte_carlo_clutter_rev3_app), exposes off-axis/aggregation path proxies, and emits a single recommended optimization target.subchunk_agg_check_maxazi_rev14.m, a focused optimization of rev11 that preserves RNG seeding, helper-call semantics, and function contract while optimizing only the aggregation path by factoring dB-to-linear conversions (precomputeoff_axis_gain_linear, convert base dBm once per MC, perform mW-domain weighted sums, then convert back withpow2db).validate_subchunk_agg_check_maxazi_rev11_rev14_statistical.m, a validator that runs rev11 and rev14 on identical inputs, measures runtime across configurable runs, computes distributional metrics (mean,std,min,max,median,p90,p95,p99, andp99.9when supported), applies stricter tail thresholds, prints a structured PASS/FAIL summary, and fails closed on drift.Testing
octave --version) showed no interpreter present, so numeric profiling and statistical validation must be run in a MATLAB-enabled environment to produce timing/profile results.opts.NumTimingRuns = 3and will raise an error on statistical drift (fail-closed) when invoked successfully.profile_subchunk_agg_check_maxazi_rev11_real(...)to identify the bottleneck, then runvalidate_subchunk_agg_check_maxazi_rev11_rev14_statistical(...)to verify thatrev14preserves behavior and provides the measured speedup.Codex Task