@@ -13,23 +13,48 @@ function _status_cell(ok::Bool, t::Float64, logFile::Union{String,Nothing})
1313 end
1414end
1515
16- function _cmp_cell (r:: ModelResult , results_root:: String )
16+ """
17+ _cmp_cell(r, results_root, csv_max_size_mb) → HTML string
18+
19+ Build the "Ref Cmp" table cell for one model row.
20+
21+ - `cmp_total == 0`: no reference data — show `—` (or just the CSV link if present).
22+ - All signals pass (`p == n`): green cell with score and a link to the sim CSV.
23+ - Some signals fail: red cell with a link to the interactive diff HTML, the diff
24+ CSV, and the sim CSV. The sim CSV link is always included when the file exists.
25+
26+ `sim_csv` is constructed as `"files/<model>/<short>_sim.csv"`, which is already a
27+ path relative to `results_root` (where `index.html` lives), so it is used directly
28+ as the `href` without further `relpath` manipulation. If the CSV was skipped
29+ because it exceeded `csv_max_size_mb` MB, a `<short>_sim.csv.toobig` marker file
30+ is present and a non-linking note is shown instead.
31+ """
32+ function _cmp_cell (r:: ModelResult , results_root:: String , csv_max_size_mb:: Int )
33+ short = split (r. name, " ." )[end ]
34+ sim_csv = joinpath (" files" , r. name, " $(short) _sim.csv" ) # relative to results_root
35+ abs_sim_csv = joinpath (results_root, sim_csv)
36+ csv_link = if isfile (abs_sim_csv)
37+ """ <a href="$sim_csv ">(CSV)</a>"""
38+ elseif isfile (abs_sim_csv * " .toobig" )
39+ """ <span title="Result file exceeds $(csv_max_size_mb) MB and was not uploaded">(CSV N/A)</span>"""
40+ else
41+ " "
42+ end
43+
1744 if r. cmp_total == 0
18- return """ <td class="na">—</td>"""
45+ return isempty (csv_link) ? """ <td class="na">—</td>""" :
46+ """ <td class="na">$(csv_link) </td>"""
1947 end
48+
2049 n, p = r. cmp_total, r. cmp_pass
2150 if p == n
22- # No diff CSV when all signals pass — link the sim CSV instead
23- short = split (r. name, " ." )[end ]
24- sim_csv = joinpath (" files" , r. name, " $(short) _sim.csv" )
25- csv_link = isfile (joinpath (results_root, sim_csv)) ? """ <a href="$sim_csv ">(CSV)</a>""" : " "
2651 return """ <td class="ok">✓ $p /$n$(csv_link) </td>"""
2752 else
28- # Link to the interactive diff HTML (next to the CSV, same name, .html extension)
53+ # Link to the interactive diff HTML (next to the diff CSV, same name, .html extension)
2954 diff_html = replace (r. cmp_csv, r" \. csv$" => " .html" )
30- rel = relpath (isfile (diff_html) ? diff_html : r. cmp_csv, results_root)
31- csv_link = isempty (r. cmp_csv) ? " " : """ <a href="$(relpath (r. cmp_csv, results_root)) ">(CSV)</a>"""
32- return """ <td class="fail"><a href="$rel ">$p /$n </a>$(csv_link) </td>"""
55+ diff_rel = relpath (isfile (diff_html) ? diff_html : r. cmp_csv, results_root)
56+ diff_csv_link = isempty (r. cmp_csv) ? " " : """ <a href="$(relpath (r. cmp_csv, results_root)) ">(diff CSV)</a>"""
57+ return """ <td class="fail"><a href="$diff_rel ">$p /$n </a>$(diff_csv_link) $(csv_link) </td>"""
3358 end
3459end
3560
@@ -49,12 +74,12 @@ function _format_duration(t::Float64)::String
4974end
5075
5176"""
52- generate_report(results, results_root, info) → report_path
77+ generate_report(results, results_root, info; csv_max_size_mb ) → report_path
5378
5479Write an `index.html` overview report to `results_root` and return its path.
5580"""
5681function generate_report (results:: Vector{ModelResult} , results_root:: String ,
57- info:: RunInfo )
82+ info:: RunInfo ; csv_max_size_mb :: Int = CSV_MAX_SIZE_MB )
5883 n = length (results)
5984 n_exp = count (r -> r. export_success, results)
6085 n_par = count (r -> r. parse_success, results)
@@ -75,7 +100,7 @@ function generate_report(results::Vector{ModelResult}, results_root::String,
75100 $(_status_cell (r. export_success, r. export_time, rel_log_file_or_nothing (results_root, r. name, " export" )))
76101 $(_status_cell (r. parse_success, r. parse_time, rel_log_file_or_nothing (results_root, r. name, " parsing" )))
77102 $(_status_cell (r. sim_success, r. sim_time, rel_log_file_or_nothing (results_root, r. name, " sim" )))
78- $(_cmp_cell (r, results_root))
103+ $(_cmp_cell (r, results_root, csv_max_size_mb ))
79104 </tr>""" for r in results], " \n " )
80105
81106 bm_sha_link = isempty (info. bm_sha) ? " " :
0 commit comments