Move every index diagnostic to standard error - #1238
Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
🤖 Augment PR SummarySummary: This PR separates CLI diagnostics from program-result output.
The CLI test harness captures stdout and stderr independently, so fixtures now assert the intended stream contract. Successful command results remain available for shell redirection and composition. 🤖 Was this summary useful? React with 👍 or 👎 |
| std::println(stderr, "Usage: {} <one.json> <path/to/output/directory>", | ||
| std::filesystem::path{program}.filename().string()); | ||
| std::print("{}", USAGE_DETAILS); | ||
| std::print(stderr, "{}", USAGE_DETAILS); |
There was a problem hiding this comment.
This stream migration remains incomplete: the --profile and --time reports still write to standard output at src/index/index.cc:735-738 and src/index/index.cc:746. Those are diagnostic option outputs, so callers redirecting standard output still receive diagnostics despite the PR's stated separation.
Severity: medium
Other Locations
src/index/index.cc:735src/index/index.cc:746
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
1 issue found across 112 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/index/index.cc">
<violation number="1" location="src/index/index.cc:311">
P2: Route the `--profile` and `--time` reports to `stderr` as well. They still write to `stdout`, so callers redirecting standard output continue receiving diagnostic output.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| std::println(stderr, "Usage: {} <one.json> <path/to/output/directory>", | ||
| std::filesystem::path{program}.filename().string()); | ||
| std::print("{}", USAGE_DETAILS); | ||
| std::print(stderr, "{}", USAGE_DETAILS); |
There was a problem hiding this comment.
P2: Route the --profile and --time reports to stderr as well. They still write to stdout, so callers redirecting standard output continue receiving diagnostic output.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/index/index.cc, line 311:
<comment>Route the `--profile` and `--time` reports to `stderr` as well. They still write to `stdout`, so callers redirecting standard output continue receiving diagnostic output.</comment>
<file context>
@@ -302,13 +302,13 @@ static auto index_main(const std::string_view &program,
+ std::println(stderr, "Usage: {} <one.json> <path/to/output/directory>",
std::filesystem::path{program}.filename().string());
- std::print("{}", USAGE_DETAILS);
+ std::print(stderr, "{}", USAGE_DETAILS);
return EXIT_FAILURE;
}
</file context>
There was a problem hiding this comment.
Benchmark Index (community)
Details
| Benchmark suite | Current: 1bca70f | Previous: 47f7daf | Ratio |
|---|---|---|---|
Add one schema (0 existing) |
316 ms |
297 ms |
1.06 |
Add one schema (100 existing) |
35 ms |
121 ms |
0.29 |
Add one schema (1000 existing) |
89 ms |
92 ms |
0.97 |
Add one schema (10000 existing) |
1118 ms |
766 ms |
1.46 |
Update one schema (1 existing) |
28 ms |
23 ms |
1.22 |
Update one schema (101 existing) |
38 ms |
35 ms |
1.09 |
Update one schema (1001 existing) |
91 ms |
106 ms |
0.86 |
Update one schema (10001 existing) |
778 ms |
775 ms |
1.00 |
Cached rebuild (1 existing) |
10 ms |
7 ms |
1.43 |
Cached rebuild (101 existing) |
12 ms |
11 ms |
1.09 |
Cached rebuild (1001 existing) |
43 ms |
24 ms |
1.79 |
Cached rebuild (10001 existing) |
354 ms |
212 ms |
1.67 |
Index 100 schemas |
656 ms |
517 ms |
1.27 |
Index 1000 schemas |
1458 ms |
1581 ms |
0.92 |
Index 10000 schemas |
13053 ms |
12042 ms |
1.08 |
Index 10000 schemas (custom meta-schema) |
15151 ms |
13180 ms |
1.15 |
Index 10000 schemas ($ref fan-out) |
15301 ms |
12793 ms |
1.20 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Benchmark Index (enterprise)
Details
| Benchmark suite | Current: 1bca70f | Previous: 47f7daf | Ratio |
|---|---|---|---|
Add one schema (0 existing) |
379 ms |
372 ms |
1.02 |
Add one schema (100 existing) |
115 ms |
121 ms |
0.95 |
Add one schema (1000 existing) |
166 ms |
176 ms |
0.94 |
Add one schema (10000 existing) |
763 ms |
785 ms |
0.97 |
Update one schema (1 existing) |
119 ms |
112 ms |
1.06 |
Update one schema (101 existing) |
113 ms |
121 ms |
0.93 |
Update one schema (1001 existing) |
165 ms |
176 ms |
0.94 |
Update one schema (10001 existing) |
794 ms |
1109 ms |
0.72 |
Cached rebuild (1 existing) |
11 ms |
11 ms |
1 |
Cached rebuild (101 existing) |
14 ms |
15 ms |
0.93 |
Cached rebuild (1001 existing) |
39 ms |
51 ms |
0.76 |
Cached rebuild (10001 existing) |
318 ms |
341 ms |
0.93 |
Index 100 schemas |
574 ms |
471 ms |
1.22 |
Index 1000 schemas |
1524 ms |
1589 ms |
0.96 |
Index 10000 schemas |
13142 ms |
12676 ms |
1.04 |
Index 10000 schemas (custom meta-schema) |
15641 ms |
14535 ms |
1.08 |
Index 10000 schemas ($ref fan-out) |
15941 ms |
15254 ms |
1.05 |
This comment was automatically generated by workflow using github-action-benchmark.
Signed-off-by: Juan Cruz Viotti jv@jviotti.com