Public: anyone can read this; the crew can change it.
Games: host the spark profiler viewer and its uploads in the forge #18058
Landed in pull #18096 · 2 runs · run
Direction change from the owner: rebuild the viewer the forge's own way, and do not host spark-viewer.
- Keep the spark mod as the sampler on the box. It is the best collector there is. Its upload goes to the forge store described above, with the same POST/
Locationcontract. - A native forge page decodes the profile. spark's
.protoschemas are published inspark-common/src/main/proto, so the page decodes the protobuf itself. It shows:- a call tree and flame graph
- the slowest ticks, and per-mod and per-plugin time
- memory, GC, and the platform and mod list
- No Next.js, no outside fetches, no mapping service. Fabric names on 1.21.6 come out of the official mappings; build a small table only if needed.
- The same data feeds the games page numbers. TPS and tick time say "not reported" today. They should come from spark's health reports, or
/spark tpsparsed at check-in, so the box's pane shows them live. - Findings link to the slow frame. For example: "tick time 62 ms p95, chunk generation 40%: pre-generate while nobody is on (C2ME)".
🤖 Generated with Claude Code
Red on three checks: pull #18096 failed its check 3 times in a row, so no builder starts on it again. The planner is asked to split this smaller or rewrite what done looks like. The last failure:
a join meets the job in order > freeze at once, then stop when memory is needed; the job goes back as interrupted, never done or abandoned
Sign in to join this conversation.
new above
offline
The spark profiler uploads every profile to the plugin author's hosted service, and its viewer fetches it, plus deobfuscation mappings, from there. The owner wants that data kept in the forge.
What to build
POST <base>/posttakes a gzipped protobuf body (Content-Type: application/x-spark-*) and answers 201 with aLocation: <key>header and no body.GET <base>/<key>returns the stored bytes with their content type, plus CORS headers for the viewer's origin.<base>carries a per-box upload secret in its path. The secret only allows writes. Reads need a forge session with the box's existing game grants (no new grant tables)./games/<box>/spark/<key>.NEXT_PUBLIC_SPARK_BASE_URLandNEXT_PUBLIC_SPARK_BYTEBIN_URLpointed at the forge.NEXT_PUBLIC_SPARK_MAPPINGS_URL,NEXT_PUBLIC_SPARK_API_URL,SPARK_JSON_SERVICE_URLandSPARK_THUMBNAIL_SERVICE_URLat the forge, or disable them. Nothing should leave.basePathtoday, so it needs a static export with a basePath patch, or a rewrite. Keep the patch as a small file in the repo.viewerUrl(with a trailing slash) andbytebinUrlinconfig/spark/config.json. Install the mod and this config together, so a box never uploads elsewhere even once.Until this ships
/spark profiler stop --save-to-filekeeps a profile local (config/spark/profile-*.sparkprofile).Sources
spark-common/.../SparkPlatform.java(the config keys)BytebinClient.java(the upload contract)src/env.tsandsrc/viewer/common/logic/fetch.tsDirection: owner, 12-04: "this is the kind of thing that i would like to build into the forge. dont love my data leaving"
🤖 Generated with Claude Code