[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78X31G1ZHTYNN6MACAXET94":3,"skill-same:01M78X31G1ZHTYNN6MACAXET94":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":46},"01M78X31G1ZHTYNN6MACAXET94","dataset-writing",null,"Convert indexable datasets or already-available WebDataset shards into validated FFCV .beton files, with ordered fields, writer controls, built-in\u002Fcustom fields, and read-back troubleshooting.","VectorSpaceLab\u002FAREX-Skill","VectorSpaceLab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F180637102?v=4","01M7538C5WPSJGWF7KHR4EFZ9F","01M7538C6R2GFP53NPXTCZNBRT",351,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Fffcv\u002Fsub-skills\u002Fdataset-writing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dataset-writing\ndescription: \"Convert indexable datasets or already-available WebDataset shards\n  into validated FFCV .beton files, with ordered fields, writer controls,\n  built-in\u002Fcustom fields, and read-back troubleshooting.\"\nmetadata:\n  disco-role: operating\ndisable-model-invocation: true\nlicense: Apache 2.0\n---\n\n# FFCV dataset writing\n\nUse this sub-skill when a Researcher must serialize an indexable dataset, or\nalready-available local WebDataset shards, into an FFCV `.beton` file. It owns\n`DatasetWriter`, field mapping\u002Forder, writer resource controls, built-in and\ncustom field encoding, and validation of the resulting file. It does not own\ntraining-time loader pipelines, augmentation design, or obtaining shards.\n\n## Operating contract\n\n**Inputs**\n\n- A destination `.beton` path. `DatasetWriter.prepare()` opens it in `wb` mode,\n  so treat an existing destination as replaceable output.\n- Either an object with `__len__` and `__getitem__`, or a list of local shard\n  paths plus a worker-safe WebDataset pipeline.\n- A mapping of short ASCII field names to `ffcv.fields.Field` instances.\n  Python mapping insertion order is the sample serialization order.\n- A source adapter whose returned tuple\u002Flist has exactly the same positions as\n  the field mapping. The writer zips values and does not provide a reliable\n  schema\u002Farity check for you.\n- Optional indexed-dataset controls: `indices`, `shuffle_indices`, and\n  positive `chunksize`; optional writer controls: `page_size` and\n  `num_workers`.\n\n**Outputs and acceptance observations**\n\n- `from_indexed_dataset(...)` or, when the optional dependency is installed,\n  `from_webdataset(...)` completes without a worker exception.\n- `Reader(path)` opens the file, the sample count and logical field names match\n  the intended output, and fixed metadata or decoded payloads match a source\n  check. A path merely existing is not success.\n- Variable-length bytes\u002FJSON are checked with their length\u002Fterminator contract,\n  not compared as if every batch had the original unpadded length.\n- A custom type-255 field is opened with the required reader registration and\n  its decoder returns the intended representation.\n\n## Non-negotiable rules\n\n1. `DatasetWriter` pairs `fields.values()` with each sample by position. A\n   mapping's insertion order is useful for the **field mapping**, but a sample\n   dict iterates its keys, not its values. Convert dict samples explicitly to a\n   tuple in the same named order.\n2. Use unique ASCII names no longer than 16 bytes. The on-disk descriptor has a\n   16-byte name slot and this build truncates longer names rather than rejecting\n   them; truncation can collide or make a field inaccessible.\n3. `NDArrayField` and `TorchTensorField` are fixed shape\u002Fdtype fields.\n   `BytesField` and `JSONField` allocate variable-size payloads. The normal\n   bytes decoder allocates each decoded batch to its largest item, so preserve\n   lengths or use a delimiter\u002Fterminator protocol when exact trimming matters.\n4. `JSONField` writes UTF-8 JSON followed by a NUL byte. Decode with\n   `BytesDecoder` and call `JSONField.unpack`; do not pass padded bytes directly\n   to `json.loads`.\n5. A non-exact built-in `Field` subclass is written with type id 255. The\n   writer has no custom registry; the reader needs a field-name-to-class\n   registration (`Loader(custom_fields=...)` or `Reader(custom_handlers=...)`).\n6. WebDataset is optional and local-only here. `from_webdataset` imports it on\n   demand, counts each shard before writing, and then processes shards in\n   workers. No network or download procedure belongs in this skill.\n\n## Fast route\n\n1. Inspect a small, typical, and largest\u002Fmost variable sample in the parent\n   process. Check tuple arity, scalar types, array shape\u002Fdtype, image layout,\n   byte-array format, and JSON encodability.\n2. Define a short ordered mapping and, for dict-shaped data, an explicit\n   `FIELD_ORDER` adapter. Start with a tiny subset and `num_workers=1`.\n3. Use the recipes in [references\u002Fworkflows.md](references\u002Fworkflows.md) for\n   indexed conversion, `indices`\u002Fshuffle\u002Fchunk controls, local WebDataset\n   conversion, structural read-back, JSON unpacking, and custom registration.\n4. Choose writer resources only after the smoke file passes. `page_size` is a\n   power of two in `[1 \u003C\u003C 21, 1 \u003C\u003C 32)`; one allocation must fit in one page.\n   `num_workers=-1` resolves to the process CPU affinity, and `chunksize`\n   controls indexed work-queue granularity.\n5. For field-specific input and serialization rules, use\n   [references\u002Ffields-and-formats.md](references\u002Ffields-and-formats.md).\n6. For failures, reduce to one worker and a small failing index, then use\n   [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md). Preserve\n   the smallest failing sample and the exact field mapping.\n\n## Built-in field selection\n\n- `IntField` and `FloatField`: fixed scalar integer\u002Ffloat metadata (int64 and\n  float64 in this build).\n- `NDArrayField(dtype, shape)`: fixed-size NumPy arrays; ragged rows need a\n  deliberate padding scheme or `BytesField` plus a length contract.\n- `TorchTensorField(torch_dtype, shape)`: fixed-size CPU torch tensors whose\n  `.numpy()` conversion succeeds; normalize CUDA or grad-tracking tensors in\n  the source adapter before writing.\n- `RGBImageField`: HWC RGB `uint8` NumPy arrays or PIL images, with raw\u002FJPEG,\n  smart\u002Fproportion, and optional max-resolution preprocessing. Normalize torch\n  images to CPU HWC `uint8`; this writer implementation does not accept a CHW\n  torch tensor directly.\n- `BytesField`: one-dimensional NumPy `uint8` arrays. Convert Python `bytes`\n  explicitly with `np.frombuffer` and define how the original length is kept.\n- `JSONField`: JSON-compatible Python values, usually dicts; use its NUL-aware\n  `unpack` helper after a `BytesDecoder` read-back.\n\n## Evidence and verified baseline\n\nThis operating graph was distilled from `setup.py`, `ffcv\u002Fwriter.py`,\n`ffcv\u002Freader.py`, the field implementations, `docs\u002Fwriting_datasets.rst`,\n`docs\u002Fquickstart.rst`, and the requested writer\u002Fcustom-field\u002FJSON\u002FWebDataset\ntests. The inspected environment reported distribution metadata `1.0.1`,\n`ffcv.__version__` `1.0.2`, Python 3.11, a passing CPU smoke conversion, and a\nsuccessful compiled-extension import. Treat the distribution\u002Fmodule version\nsplit as a provenance warning: recreate and read files with the same installed\nbuild rather than assuming labels alone prove format compatibility.\n\nNo bundled executable script is included. A generic writer script would have to\nguess the user's schema, source lifetime, output replacement policy, optional\nWebDataset availability, page size, worker count, and custom-field classes;\nits multiprocessing and disk allocation side effects make reference-only\nrecipes safer for this sub-skill.\n","# FFCV dataset writing\n\nUse this sub-skill when a Researcher must serialize an indexable dataset, or\nalready-available local WebDataset shards, into an FFCV `.beton` file. It owns\n`DatasetWriter`, field mapping\u002Forder, writer resource controls, built-in and\ncustom field encoding, and validation of the resulting file. It does not own\ntraining-time loader pipelines, augmentation design, or obtaining shards.\n\n## Operating contract\n\n**Inputs**\n\n- A destination `.beton` path. `DatasetWriter.prepare()` opens it in `wb` mode,\n  so treat an existing destination as replaceable output.\n- Either an object with `__len__` and `__getitem__`, or a list of local shard\n  paths plus a worker-safe WebDataset pipeline.\n- A mapping of short ASCII field names to `ffcv.fields.Field` instances.\n  Python mapping insertion order is the sample serialization order.\n- A source adapter whose returned tuple\u002Flist has exactly the same positions as\n  the field mapping. The writer zips values and does not provide a reliable\n  schema\u002Farity check for you.\n- Optional indexed-dataset controls: `indices`, `shuffle_indices`, and\n  positive `chunksize`; optional writer controls: `page_size` and\n  `num_workers`.\n\n**Outputs and acceptance observations**\n\n- `from_indexed_dataset(...)` or, when the optional dependency is installed,\n  `from_webdataset(...)` completes without a worker exception.\n- `Reader(path)` opens the file, the sample count and logical field names match\n  the intended output, and fixed metadata or decoded payloads match a source\n  check. A path merely existing is not success.\n- Variable-length bytes\u002FJSON are checked with their length\u002Fterminator contract,\n  not compared as if every batch had the original unpadded length.\n- A custom type-255 field is opened with the required reader registration and\n  its decoder returns the intended representation.\n\n## Non-negotiable rules\n\n1. `DatasetWriter` pairs `fields.values()` with each sample by position. A\n   mapping's insertion order is useful for the **field mapping**, but a sample\n   dict iterates its keys, not its values. Convert dict samples explicitly to a\n   tuple in the same named order.\n2. Use unique ASCII names no longer than 16 bytes. The on-disk descriptor has a\n   16-byte name slot and this build truncates longer names rather than rejecting\n   them; truncation can collide or make a field inaccessible.\n3. `NDArrayField` and `TorchTensorField` are fixed shape\u002Fdtype fields.\n   `BytesField` and `JSONField` allocate variable-size payloads. The normal\n   bytes decoder allocates each decoded batch to its largest item, so preserve\n   lengths or use a delimiter\u002Fterminator protocol when exact trimming matters.\n4. `JSONField` writes UTF-8 JSON followed by a NUL byte. Decode with\n   `BytesDecoder` and call `JSONField.unpack`; do not pass padded bytes directly\n   to `json.loads`.\n5. A non-exact built-in `Field` subclass is written with type id 255. The\n   writer has no custom registry; the reader needs a field-name-to-class\n   registration (`Loader(custom_fields=...)` or `Reader(custom_handlers=...)`).\n6. WebDataset is optional and local-only here. `from_webdataset` imports it on\n   demand, counts each shard before writing, and then processes shards in\n   workers. No network or download procedure belongs in this skill.\n\n## Fast route\n\n1. Inspect a small, typical, and largest\u002Fmost variable sample in the parent\n   process. Check tuple arity, scalar types, array shape\u002Fdtype, image layout,\n   byte-array format, and JSON encodability.\n2. Define a short ordered mapping and, for dict-shaped data, an explicit\n   `FIELD_ORDER` adapter. Start with a tiny subset and `num_workers=1`.\n3. Use the recipes in [references\u002Fworkflows.md](references\u002Fworkflows.md) for\n   indexed conversion, `indices`\u002Fshuffle\u002Fchunk controls, local WebDataset\n   conversion, structural read-back, JSON unpacking, and custom registration.\n4. Choose writer resources only after the smoke file passes. `page_size` is a\n   power of two in `[1 \u003C\u003C 21, 1 \u003C\u003C 32)`; one allocation must fit in one page.\n   `num_workers=-1` resolves to the process CPU affinity, and `chunksize`\n   controls indexed work-queue granularity.\n5. For field-specific input and serialization rules, use\n   [references\u002Ffields-and-formats.md](references\u002Ffields-and-formats.md).\n6. For failures, reduce to one worker and a small failing index, then use\n   [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md). Preserve\n   the smallest failing sample and the exact field mapping.\n\n## Built-in field selection\n\n- `IntField` and `FloatField`: fixed scalar integer\u002Ffloat metadata (int64 and\n  float64 in this build).\n- `NDArrayField(dtype, shape)`: fixed-size NumPy arrays; ragged rows need a\n  deliberate padding scheme or `BytesField` plus a length contract.\n- `TorchTensorField(torch_dtype, shape)`: fixed-size CPU torch tensors whose\n  `.numpy()` conversion succeeds; normalize CUDA or grad-tracking tensors in\n  the source adapter before writing.\n- `RGBImageField`: HWC RGB `uint8` NumPy arrays or PIL images, with raw\u002FJPEG,\n  smart\u002Fproportion, and optional max-resolution preprocessing. Normalize torch\n  images to CPU HWC `uint8`; this writer implementation does not accept a CHW\n  torch tensor directly.\n- `BytesField`: one-dimensional NumPy `uint8` arrays. Convert Python `bytes`\n  explicitly with `np.frombuffer` and define how the original length is kept.\n- `JSONField`: JSON-compatible Python values, usually dicts; use its NUL-aware\n  `unpack` helper after a `BytesDecoder` read-back.\n\n## Evidence and verified baseline\n\nThis operating graph was distilled from `setup.py`, `ffcv\u002Fwriter.py`,\n`ffcv\u002Freader.py`, the field implementations, `docs\u002Fwriting_datasets.rst`,\n`docs\u002Fquickstart.rst`, and the requested writer\u002Fcustom-field\u002FJSON\u002FWebDataset\ntests. The inspected environment reported distribution metadata `1.0.1`,\n`ffcv.__version__` `1.0.2`, Python 3.11, a passing CPU smoke conversion, and a\nsuccessful compiled-extension import. Treat the distribution\u002Fmodule version\nsplit as a provenance warning: recreate and read files with the same installed\nbuild rather than assuming labels alone prove format compatibility.\n\nNo bundled executable script is included. A generic writer script would have to\nguess the user's schema, source lifetime, output replacement policy, optional\nWebDataset availability, page size, worker count, and custom-field classes;\nits multiprocessing and disk allocation side effects make reference-only\nrecipes safer for this sub-skill.\n",{"name":5,"license":23,"metadata":24,"description":7,"disable-model-invocation":26},"Apache 2.0",{"disco-role":25},"operating",true,"main","ac3fe1afa80fb9a09775ecfb2b6cc3ba850a2db6","skills\u002Frepositories\u002Frepo-skills\u002Fffcv\u002Fsub-skills\u002Fdataset-writing",27,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab","2026-09-03 10:25:21",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":26},[36,39,42],{"tool":37,"command":38},"npx","npx skills add VectorSpaceLab\u002FAREX-Skill --skill dataset-writing",{"tool":40,"command":41},"bunx","bunx skills add VectorSpaceLab\u002FAREX-Skill --skill dataset-writing",{"tool":43,"command":44},"pnpm","pnpm dlx skills add VectorSpaceLab\u002FAREX-Skill --skill dataset-writing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Fffcv\u002Fsub-skills\u002Fdataset-writing\u002FSKILL.md",[47,53,57],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Ffields-and-formats.md","REFERENCE","参考文档",8718,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Fffcv\u002Fsub-skills\u002Fdataset-writing\u002Freferences\u002Ffields-and-formats.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Ftroubleshooting.md",6513,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Fffcv\u002Fsub-skills\u002Fdataset-writing\u002Freferences\u002Ftroubleshooting.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fworkflows.md",7848,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Fffcv\u002Fsub-skills\u002Fdataset-writing\u002Freferences\u002Fworkflows.md",[62,69,76,83,90,97],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M799NYSH1R3RVAHSM2D88Y84","passnet-triton-opt","Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block\u002Fgrid\u002Fwarp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-triton-opt\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M799NS5APEC0N1FZ7XZVW6BN","passnet-solve","END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-solve\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M799NNY9BKSM21V5R7QVTBJX","passnet-skill","PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under .\u002Fpass_dir\u002F, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-skill\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M799NHH6NP7Z1RK77KGXAN6S","passnet-pattern-fusion","Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()\u002Freplacement_args()\u002Freplacement_func() files, when a pass \"failed to match\", or when deciding how to fuse multiple kernels\u002Fops.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-pattern-fusion\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M799ND2J4WNC2PGAZ0A06NDF","passnet-orchestrate","Round\u002Fbatch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep\u002Frevert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-orchestrate\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M799N8SBTMY02ZDG2AZF5ZWE","passnet-feedback","Fast, deterministic feedback for PassNet work: pre-flight pattern\u002Fmatch verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-feedback\u002FSKILL.md",[],[]]