Skip to content

Fix several regressions from adoption of JSONL file format#276

Open
ebkalderon wants to merge 6 commits intoplasma-umass:masterfrom
ebkalderon:fix-jsonl-parse-errors
Open

Fix several regressions from adoption of JSONL file format#276
ebkalderon wants to merge 6 commits intoplasma-umass:masterfrom
ebkalderon:fix-jsonl-parse-errors

Conversation

@ebkalderon
Copy link
Copy Markdown
Contributor

@ebkalderon ebkalderon commented Mar 27, 2026

Summary

This pull request fixes several regressions that have gone largely unaddressed since the JSONL file format was first adopted back in PR #268. With these changes, the coz plot viewer should now parse throughput-points and latency-points correctly and display them. 🎉

On another note, it seems the existing CTest test suite has been in a semi-broken state since both #268 and #275, so I fixed those tests up and hooked them up to GitHub Actions (they seemingly haven't been executed in CI until now).

Review Notes

I would recommend reviewing these changes commit-by-commit, including the explanatory commit messages. Two friendly questions for the coz maintainers (elaborated on more in the commit messages):

  1. Regarding ec0e449, I've confirmed that the changes fix the coz plot viewer bugs for profile.jsonl, but I haven't confirmed whether this also fixes the similar-looking bugs in the legacy profile.coz format reported in Invalid Profile: The profile you loaded contains an invalid line: delta #215. I would love some external confirmation!
  2. Regarding 1122f15, would you like me to keep or remove the backwards-compatible code paths I've included? Considering coz is still in a "0.x.y" semantic versioning state, I'm personally okay with removing them, but I defer to your judgment. 😊 Please let me know, and I'd be happy to push a fast-followup commit to this branch.

Thanks for your fantastic work on coz over the years! I love the concept behind this tool, and I'm keen to use it with my own projects.

Closes #206
Closes #215

It turns out that the TypeScript parser and C++ emitters are pretty
inconsistent with their uses of the `-` and `_` characters for marking
throughput/latency points. This seems to be the root cause of this bug:

plasma-umass#215 (comment)

Please note that I haven't reproduced the bug in the top-most GitHub
issue description, because I don't have an affected `profile.coz` file
to test against.
Going forward, `coz` will consistently emit "throughput-point" and
"latency-point" in the JSONL output format. This fixes a regression
accidentally introduced in this commit from last month:

plasma-umass@1f62ab2

Unfortunately, now that we have JSONL-formatted profiling results using
the malformed "throughput_point" and "latency_point" strings in the
wild, the TypeScript `coz` viewer is probably stuck supporting both
naming conventions forever (unless the maintainers are okay with
breaking changes, given that `coz` bears a 0.x.y version string).
Both the `dwarf_scope` `kmeans` tests both fail on my machine due to
regressions introduced the previous transition to the JSONL format.
This commit fixes all those broken tests.
Apparently these were never executed in CI until now, so this commit
adds a `step` for them. Hopefully it works...
@ebkalderon
Copy link
Copy Markdown
Contributor Author

Rebased and force-pushed to fix merge conflicts after #277 and #278 were merged. Ready for your review again, @emeryberger! ☺️

@ebkalderon

This comment was marked as resolved.

@ebkalderon

This comment was marked as resolved.

@ebkalderon
Copy link
Copy Markdown
Contributor Author

Nice, looks like CI successfully passes with all CTests running! 🎉

@ebkalderon
Copy link
Copy Markdown
Contributor Author

ebkalderon commented Mar 28, 2026

Okay, I'm logging off for the night. Everything should be ready for review now. Feel free to reach out anytime if you have concerns/questions/feedback about the design choices, and I'll reply ASAP. Thanks! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid Profile: The profile you loaded contains an invalid line: delta Consider adding a CI

1 participant