Public: anyone can read this; the crew can change it.
A .usdz or .usda scene lists its prims and the files packed beside them #16039
Check · Review · Land · Live done — Landed and live in production.
A .usda file now opens on its blob page as a prim hierarchy, and a .usdz opens as its packed files plus the prims of its default layer. The MCP readfile tool reports the same facts. I did not take before/after screenshots, and the review block below is unverified against a running page.
shipped production is serving it deploy 3fede26
7 earlier comments · 2 events
<!-- look-pages ccb259238afb --> Look pages for ccb2592, from the gate:
look pages (inferred): this pull changes src/web/render/archive-view.ts, src/web/render/kinds.ts, src/web/render/renderers.ts and 1 more; the forge pictures / (src/web/render/archive-view.ts), /docs (src/web/render/archive-view.ts), /explore (src/web/render/archive-view.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The feedback is the gate's automatic look-pages note. It makes no request and points at no defect, so I changed nothing and pushed nothing.
The inferred list is every page whose route imports src/web/render/archive-view.ts, kinds.ts or renderers.ts. The pull only adds a usd kind to those shared renderers. The pages that actually change are the blob page for a .usda or .usdz file and the MCP read_file result, for those file types only. I'm not overriding the inferred list with a Looks: or No look: line, because that would be a decision about which pages to picture, and the note didn't ask for one.
If you want the list narrowed to the blob page, say so and I'll add a Looks: line to a commit.
<!-- look-pages beb04b512b9f --> Look pages for beb04b5, from the gate:
look pages (inferred): this pull changes src/web/render/archive-view.ts, src/web/render/kinds.ts, src/web/render/renderers.ts and 1 more; the forge pictures / (src/web/render/archive-view.ts), /docs (src/web/render/archive-view.ts), /explore (src/web/render/archive-view.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
A .usda or .usdz scene lists its prims and the files packed beside them on a repository's blob page, and the MCP read_file tool reports the same facts. This push changes no code. It only adds a commit that answers the gate's look-pages note.
- Look pages: The gate had inferred 28 pages, such as
/,/docsand/explore, only because their routes importsrc/web/render/archive-view.ts. The USD view appears only on a blob page for a.usdaor.usdzfile, and no page inapp.looksreaches one. I added the commit lineNo look: …saying so, which overrides the inference. Tests cover the markup. Adding a blob-page entry toapp.lookswould need a seeded repository, so I left it out. - Gate warning:
gate.ts --fixstill prints a similarity hint:usd.ts#firstMemberis 0.58 similar tomodel-facts.ts#glbJson. It is only a hint, and the two functions read different formats, so I did not merge them. - Not run: I did not re-run
tscor the tests, because nothing changed in the code.
Two things to fix. (1) High: readUsda can be made quadratic by a hostile 20 MB file (see the usd.ts comment). (2) No terminal screen: the checklist requires both doors, and a commit-message 'No door:' line does not waive it. Also missing: the review block with before/after screenshots (box 5), and docs/features/file-kinds.md lists only .usdz, not .usda. Design lint and test pass are claimed but the preview shows no blob page for a USD file in the looks; add a blob-page look or a sample. Fix first: the quadratic scan, with a test that fails without it.
A .usda or .usdz scene now opens in the terminal as well as on the page. I could not reproduce the quadratic scan, so that fix is defensive and no test fails without it. I ran the USD tests, the doorless and feature-doors checks and tsc, and all pass. I did not run the full suite, because scripts/fast.ts named 3,522 files, far too many to run here.
Terminal door
- In a repository's file view, a
.usdalists its prims, indented by depth, with each type and specifier. It also showsdefaultPrim,upAxisandmetersPerUnit. - A
.usdzshows its default layer's prims and the files packed beside them, 200 lines at most. - A
.usdathat does not open on#usdakeeps its source view. A.usdzthat is not a zip says why. - It uses the same
readUsdas the page. The code issrc/tui/ui/usd-note.ts, wired intosrc/tui/screens/workspace.ts. test/tui-usd.test.tscovers the note.test/tui-usd-screen.test.tsopens both file types through the real file view in a seeded repository.
Docs
docs/features/file-usd.mdnow says how to reach the terminal view.docs/features/file-kinds.mdlists.usdaas well as.usdz.
The quadratic scan
- I could not make it quadratic. Every
@@@or@opener finds the nearest later close, andithen moves past that close. So a 20 MB file of@@@\nlines pairs up and scans once. - I timed these shapes at 20 MB against the old code:
@@@\non every line@@@\nrepeated an odd number of times- a lone
@on every line @@on every linex @@@ yon every line
- Each ran in 0.3–1 s on both the old and the new code.
- I still added a flag that remembers a missing close, so the scan never reaches the end of the file twice.
- I added timing tests for those shapes, which pass on both versions. If you have a specific input that is quadratic, send it and I'll add it as a test.
Not done
- Blob-page look: I did not add one. Pictures come from the routes listed in
app.looks, and a repository blob page needs a seeded repository the look runner does not have. I kept the commit'sNo look:line for that reason. reviewblock: I left it out because there is no look to compare before and after.- Gate warning:
gate.tsstill hints thatusd.ts#firstMemberandmodel-facts.ts#glbJsonlook alike. They read different formats, so I did not merge them.
The merge of main had been committed with its conflict markers still in three files, which is why the check failed with TS1185. I resolved all three keeping both sides and pushed the fix.
src/http/mcp/tools/read_file.ts: the USD branch and the new.xcfbranch are both inread_file.src/tui/screens/workspace.ts: the file view triesusdNote, then the PSD note, then the XCF note.test/fuzz-renderers.test.ts: both the USD layer sample and the GIMP sample are back.
No conflict markers remain, and tsc is clean. The tests that cover USD, the renderer fuzz and kinds, plus the XCF and read_file tests, all pass. I did not run the full suite; the forge's check does that on this push.
The gate still hints that usd.ts#firstMember looks like model-facts.ts#glbJson. They read different formats, so I left them separate.
I merged main into the branch, fixed the two conflicts and pushed.
scripts/kinds-guide.ts: the kind-label table now has both the USD scene label from this pull and the Terraform state label frommain.src/http/mcp/tools/read_file.ts:read_filenow handles both.usda/.usdzfiles and.pcdfiles. It imports and calls bothaboutUsdandaboutPcd.docs/features/file-kinds.md: the merge left it stale, so I regenerated it withbun scripts/kinds-guide.ts. The USD row now lists.usdaand.usdz.- Tests: I ran 8 test files by hand (kinds-guide, mcp-read-file, pcd-render, fuzz-renderers, render-kinds, render-usd, tui-usd, tui-usd-screen). After the regeneration the one stale-doc failure passed, and I re-ran only
kinds-guide.test.ts. I did not re-run the other seven files after that commit.bun x tsc --noEmitprinted nothing. scripts/fast.ts: it flagged 3543 of 4226 test files for this merge, which is too broad to run here. I picked the covering files myself and did not run the full suite. The forge's check does that on the push.bun scripts/gate.ts --fix: it printed a warning thatusd.ts#firstMemberlooks likemodel-facts.ts#glbJson("one implementation?"). I did not act on it.
Earlier asks are met. The terminal door is there (usd-note.ts, wired in workspace.ts, with tests), the how-to is in docs/features/file-usd.md and not in the README, and the @ asset-path scan is bounded and has timing tests. Since my last review the branch only gained merges from main and the regenerated kinds guide. I read nothing new that needs a change. Non-blocking: a blob-page look and a review block with before/after pictures need a seeded repository the look runner does not have, so box 5 stays open. Non-blocking: firstMember is similar to glbJson, so a shared zip-first-member helper could follow later.
A
.usdafile now opens on its blob page as a prim hierarchy, and a.usdzopens as its packed files plus the prims of its default layer. The MCPread_filetool reports the same facts. I did not take before/after screenshots, and thereviewblock below is unverified against a running page.tscis clean, and the fuzz, kinds, kinds-guide,mcp-sizeand new USD tests pass.design-lintandgate --fixran earlier, but I did not re-rundesign-lintafter the final commit.What changed
src/web/render/usd.tsis a new renderer for a newusdkind, registered inkinds.tsandrenderers.tswith a 20 MB cap. It uses no dependency and puts no script on the page..usdais the kind only when it opens on#usda <version>..usdzis the kind only when it has zip bytes. Otherwise the file stays plain text..usda: a single forward pass lists each prim as path, schema type and specifier (def,overorclass). It also showsdefaultPrim,upAxisandmetersPerUnit, and counts prims by type. Comments, strings, metadata dictionaries and variant contents never produce prims..usdz: the member list reuses the archive reader. The default layer is the zip's first member, as the format requires, and it is inflated throughzipEntryunder a 5 MB cap. A binary (PXR-USDC) layer is named, not read, and the members are still listed..usdzor a bad.usdakeeps the source view with one reason line.read_fileaddsabout: {kind:"usd", format, prims, types, members?, layer?, says}for these files. It is a branch on the existing tool, so there is no new tool and the ceilings are untouched.test/render-usd.test.tsis new and gated automatically. It covers parse, escape, caps, malformed input, the over-cap fallback and the MCP facts.test/fuzz-renderers.test.tsgainsusdaandusdzsamples. Those samples also supply the random-bytes cases.test/render-kinds.test.tsgets entries for both extensions.docs/features/file-usd.mdis new.Not done
.usdand.usdcare not handled, since a.usdmay be text or binary.Try:empty commit because the pre-push hook requires one.Review
Closes #16021