[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KGGF6P9A21FNWY47SQMSBY":3,"skill-same:01M6KGGF6P9A21FNWY47SQMSBY":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":60},"01M6KGGF6P9A21FNWY47SQMSBY","wave8-ijobchunk-use-enabled-mask-guard",null,"Correctly handle the enableable component bitmask in IJobChunk to avoid processing disabled entities or skipping enabled ones.","dyCuong03\u002Funity-agent-team","dyCuong03","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F137050365?v=4","01M6KFXC85HQHXZJC2VC1KY6EZ","CuongND","01M6KFXCCHP6CD5MTA8NECJC36",8,"MIT","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave8-ijobchunk-use-enabled-mask-guard\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"guard","use","mask","wave8 ijobchunk use enabled mask guard","component","jobs","processing","true","enableable","enableable component","chunks","antipattern","2026-11-10 10:12:30",false,"﻿---\nname: wave8-ijobchunk-use-enabled-mask-guard\ndescription: Correctly handle the enableable component bitmask in IJobChunk to avoid processing disabled entities or skipping enabled ones.\ntags: [jobs, chunks, enableable, antipattern]\nmetadata:\n  internal-only: true\n  tier: 3\n---\n\n# IJobChunk useEnabledMask Guard\n\n## Intent\nCorrectly handle the enableable component bitmask in IJobChunk to avoid processing disabled entities or skipping enabled ones.\n\n## Use When\n- An IJobChunk implementation iterates over chunks that contain one or more IEnableableComponent types\n- The query includes any component that implements IEnableableComponent\n\n## Avoid When\n- The job uses IJobEntity — IJobEntity handles the enableable mask automatically; this guard is only needed in IJobChunk\n- No IEnableableComponent types are in the query — useEnabledMask will always be false; the fast path handles all entities\n\n## Senior Pattern\n```csharp\n[BurstCompile]\npublic struct ProcessActiveEntitiesJob : IJobChunk\n{\n    public ComponentTypeHandle\u003CVelocity> VelocityHandle;\n    [ReadOnly] public ComponentTypeHandle\u003CActiveTag> ActiveTagHandle;  \u002F\u002F IEnableableComponent\n    [ReadOnly] public EntityTypeHandle EntityHandle;\n\n    [BurstCompile]\n    public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex,\n        bool useEnabledMask, in v128 chunkEnabledMask)\n    {\n        var velocities = chunk.GetNativeArray(ref VelocityHandle);\n\n        if (useEnabledMask)\n        {\n            \u002F\u002F Some entities in chunk may be disabled — iterate only enabled ones:\n            var enumerator = new ChunkEntityEnumerator(useEnabledMask, chunkEnabledMask, chunk.Count);\n            while (enumerator.NextEntityIndex(out int i))\n            {\n                velocities[i] = new Velocity { Value = velocities[i].Value * 0.9f };\n            }\n        }\n        else\n        {\n            \u002F\u002F All entities in chunk are enabled — iterate all without mask overhead:\n            for (int i = 0; i \u003C chunk.Count; i++)\n            {\n                velocities[i] = new Velocity { Value = velocities[i].Value * 0.9f };\n            }\n        }\n    }\n}\n\n\u002F\u002F Schedule — query includes IEnableableComponent type:\nEntityQuery query = state.GetEntityQuery(\n    ComponentType.ReadWrite\u003CVelocity>(),\n    ComponentType.ReadOnly\u003CActiveTag>());\n\nstate.Dependency = new ProcessActiveEntitiesJob\n{\n    VelocityHandle  = state.GetComponentTypeHandle\u003CVelocity>(),\n    ActiveTagHandle = state.GetComponentTypeHandle\u003CActiveTag>(isReadOnly: true),\n    EntityHandle    = state.GetEntityTypeHandle()\n}.ScheduleParallel(query, state.Dependency);\n```\n\n## Anti-Patterns\n- Ignoring `useEnabledMask` and iterating all `chunk.Count` entities — silently processes disabled entities; incorrect simulation results for all state-machine patterns built on IEnableableComponent.\n- Using a manual bitmask check instead of ChunkEntityEnumerator — error-prone; re-invents platform-specific SIMD bitmask iteration logic.\n- Calling `ArchetypeChunk.GetEnabledMask()` without checking `useEnabledMask` first — unnecessary work when all entities in the chunk are enabled.\n- Using IJobChunk when IJobEntity would suffice — IJobEntity handles the mask automatically; prefer it unless chunk-level access is required.\n\n## Runtime Risks\n- Skipping the useEnabledMask guard silently processes disabled entities — no exception, no warning.\n- For IEnableableComponent-based state machines (dead\u002Falive, sleeping\u002Fawake), this means dead or sleeping entities receive updates they should not — correctness bug that manifests as incorrect game behavior.\n\n## Performance Notes\n- ChunkEntityEnumerator uses SIMD bitmask iteration internally — faster than a manual branch-per-entity loop.\n- The `useEnabledMask == false` fast path skips bitmask overhead entirely for fully-enabled chunks, which is the common case in well-organized archetypes.\n- Prefer IJobEntity over IJobChunk for new systems — it eliminates this boilerplate and handles the mask automatically.\n\n## Architecture Guidance\n- For new systems, prefer IJobEntity (mask is automatic). Use IJobChunk only when chunk-level access is required (pointer arithmetic, DidChange, per-chunk scratch buffers).\n- When using IJobChunk with any IEnableableComponent in the query, the `useEnabledMask` guard + `ChunkEntityEnumerator` pattern is mandatory — treat it as non-negotiable.\n\n## Related Skills\n[[wave4-ijobchunk-full-anatomy]], [[enableable-component]], [[wave6-with-disabled-query-filter]], [[wave8-enableable-component-query-mismatch]]\n","# IJobChunk useEnabledMask Guard\n\n## Intent\nCorrectly handle the enableable component bitmask in IJobChunk to avoid processing disabled entities or skipping enabled ones.\n\n## Use When\n- An IJobChunk implementation iterates over chunks that contain one or more IEnableableComponent types\n- The query includes any component that implements IEnableableComponent\n\n## Avoid When\n- The job uses IJobEntity — IJobEntity handles the enableable mask automatically; this guard is only needed in IJobChunk\n- No IEnableableComponent types are in the query — useEnabledMask will always be false; the fast path handles all entities\n\n## Senior Pattern\n```csharp\n[BurstCompile]\npublic struct ProcessActiveEntitiesJob : IJobChunk\n{\n    public ComponentTypeHandle\u003CVelocity> VelocityHandle;\n    [ReadOnly] public ComponentTypeHandle\u003CActiveTag> ActiveTagHandle;  \u002F\u002F IEnableableComponent\n    [ReadOnly] public EntityTypeHandle EntityHandle;\n\n    [BurstCompile]\n    public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex,\n        bool useEnabledMask, in v128 chunkEnabledMask)\n    {\n        var velocities = chunk.GetNativeArray(ref VelocityHandle);\n\n        if (useEnabledMask)\n        {\n            \u002F\u002F Some entities in chunk may be disabled — iterate only enabled ones:\n            var enumerator = new ChunkEntityEnumerator(useEnabledMask, chunkEnabledMask, chunk.Count);\n            while (enumerator.NextEntityIndex(out int i))\n            {\n                velocities[i] = new Velocity { Value = velocities[i].Value * 0.9f };\n            }\n        }\n        else\n        {\n            \u002F\u002F All entities in chunk are enabled — iterate all without mask overhead:\n            for (int i = 0; i \u003C chunk.Count; i++)\n            {\n                velocities[i] = new Velocity { Value = velocities[i].Value * 0.9f };\n            }\n        }\n    }\n}\n\n\u002F\u002F Schedule — query includes IEnableableComponent type:\nEntityQuery query = state.GetEntityQuery(\n    ComponentType.ReadWrite\u003CVelocity>(),\n    ComponentType.ReadOnly\u003CActiveTag>());\n\nstate.Dependency = new ProcessActiveEntitiesJob\n{\n    VelocityHandle  = state.GetComponentTypeHandle\u003CVelocity>(),\n    ActiveTagHandle = state.GetComponentTypeHandle\u003CActiveTag>(isReadOnly: true),\n    EntityHandle    = state.GetEntityTypeHandle()\n}.ScheduleParallel(query, state.Dependency);\n```\n\n## Anti-Patterns\n- Ignoring `useEnabledMask` and iterating all `chunk.Count` entities — silently processes disabled entities; incorrect simulation results for all state-machine patterns built on IEnableableComponent.\n- Using a manual bitmask check instead of ChunkEntityEnumerator — error-prone; re-invents platform-specific SIMD bitmask iteration logic.\n- Calling `ArchetypeChunk.GetEnabledMask()` without checking `useEnabledMask` first — unnecessary work when all entities in the chunk are enabled.\n- Using IJobChunk when IJobEntity would suffice — IJobEntity handles the mask automatically; prefer it unless chunk-level access is required.\n\n## Runtime Risks\n- Skipping the useEnabledMask guard silently processes disabled entities — no exception, no warning.\n- For IEnableableComponent-based state machines (dead\u002Falive, sleeping\u002Fawake), this means dead or sleeping entities receive updates they should not — correctness bug that manifests as incorrect game behavior.\n\n## Performance Notes\n- ChunkEntityEnumerator uses SIMD bitmask iteration internally — faster than a manual branch-per-entity loop.\n- The `useEnabledMask == false` fast path skips bitmask overhead entirely for fully-enabled chunks, which is the common case in well-organized archetypes.\n- Prefer IJobEntity over IJobChunk for new systems — it eliminates this boilerplate and handles the mask automatically.\n\n## Architecture Guidance\n- For new systems, prefer IJobEntity (mask is automatic). Use IJobChunk only when chunk-level access is required (pointer arithmetic, DidChange, per-chunk scratch buffers).\n- When using IJobChunk with any IEnableableComponent in the query, the `useEnabledMask` guard + `ChunkEntityEnumerator` pattern is mandatory — treat it as non-negotiable.\n\n## Related Skills\n[[wave4-ijobchunk-full-anatomy]], [[enableable-component]], [[wave6-with-disabled-query-filter]], [[wave8-enableable-component-query-mismatch]]\n",{"name":5,"tags":36,"metadata":37,"description":7},[24,29,27,30],{"tier":38,"internal-only":39},3,true,"main","fe4746b9f07e6c7c2b6d3932002183af9b9f6fa2",".claude\u002Fskills\u002Funity-dots\u002Fwave8-ijobchunk-use-enabled-mask-guard",0,"https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team","https:\u002F\u002Fgithub.com\u002FdyCuong03","Game developer","2026-07-25 22:22:25",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":39},[50,53,56],{"tool":51,"command":52},"npx","npx skills add dyCuong03\u002Funity-agent-team --skill wave8-ijobchunk-use-enabled-mask-guard",{"tool":54,"command":55},"bunx","bunx skills add dyCuong03\u002Funity-agent-team --skill wave8-ijobchunk-use-enabled-mask-guard",{"tool":57,"command":58},"pnpm","pnpm dlx skills add dyCuong03\u002Funity-agent-team --skill wave8-ijobchunk-use-enabled-mask-guard","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave8-ijobchunk-use-enabled-mask-guard\u002FSKILL.md",[],[62,86,110,134,154,175],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":31},"01M6KH55FFS00ET877QSMRYGX4","dots-update-groups","How to choose the right ECS system group and ordering so per-frame and per-fixed-step work is deterministic and never races its own readers. Covers InitializationSystemGroup \u002F SimulationSystemGroup \u002F PresentationSystemGroup \u002F FixedStepSimulationSystemGroup \u002F VariableRateSimulationSystemGroup, UpdateBefore \u002F UpdateAfter peer ordering, OrderFirst \u002F OrderLast group-boundary placement, RateManager, and the cross-group ordering trap. Use when adding an ISystem, fixing \"value visible one frame late\" bugs, or coupling simulation to a fixed timestep.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-update-groups\u002FSKILL.md",[],[69,70,71,72,73,74,75,76,20,77,78,79,80,81,82,83,84,85],"update","dots update groups","boundary","simulation","how","system","choose","work","never","peer","deterministic","how to","coupling","ecs","bugs","frame","value",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":31},"01M6KH50PWYEFQDCGYBZ0326F1","dots-transform-patterns","The Entities 1.x transform model — LocalTransform (writable input) vs LocalToWorld (system-owned matrix), Parent\u002FChild hierarchy, reparenting cost, uniform vs non-uniform scale (PostTransformMatrix), and when to opt out with custom transform systems. Use when designing parent\u002Fchild hierarchies, runtime reparenting (mount\u002Fdismount\u002Fsocket), or choosing transform components at the Baker boundary.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-transform-patterns\u002FSKILL.md",[],[93,94,95,96,71,74,97,98,20,99,100,101,102,103,104,105,106,107,108,109],"patterns","transform","dots transform patterns","components","mount","model","cost","runtime","systems","input","with","matrix","socket","at","child","custom","hierarchy",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":121,"publishedAt":31},"01M6KH4VW4MA14DQW4KQYPFT0S","dots-singleton-patterns","Model cross-system shared configuration and game state as a single-entity component with a strict single-writer contract. Covers RequireForUpdate gating, SystemAPI.GetSingleton \u002F GetSingletonRW \u002F HasSingleton \u002F TryGetSingleton, bake-time vs runtime-created vs ECB-system singletons, the \"exactly one entity\" runtime invariant, and the single-writer rule. Use when designing frame-stable global config, shared mutable state, or any component intended to exist on exactly one entity.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-singleton-patterns\u002FSKILL.md",[116],{"categoryNo":117,"categoryName":118,"taxonomyType":119,"taxonomyTypeDesc":120},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[93,122,123,23,124,125,126,74,98,20,127,128,129,100,130,131,103,84,132,133],"singleton","dots singleton patterns","config","state","game","writer","time","shared","contract","as","ecb","gating",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":31},"01M6KH4PR076AYNDZHD63HHWX6","dots-hybrid-bridge","The one-way bridge between DOTS-owned runtime state and Unity-owned presentation. Covers UnityObjectRef for managed asset refs in components, the DOTS-writes \u002F Unity-reads ownership rule, when to use managed IComponentData vs UnityObjectRef vs CompanionComponent, baker-bridge vs runtime-bridge, and SubScene boundary rules. Use when an entity must reference Unity assets (Mesh, Material, AudioClip, ScriptableObject), a MonoBehaviour view must read entity state, or input\u002FUI must trigger ECS work.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-hybrid-bridge\u002FSKILL.md",[],[141,142,143,144,96,125,71,145,146,76,147,148,20,100,149,150,102,151,152,153],"bridge","hybrid","dots hybrid bridge","mesh","assets","Rules","read","view","trigger","unity","material","for","managed",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":31},"01M6KH4FGRQ9AP2ND5H5HX4D83","dots-event-driven-ecs","Model one-frame events and external requests in ECS without dual ownership, polling, or persistent state leaks. Covers request-tag pattern with ECB, enableable command components (no structural change), event buffers (IBufferElementData), explicit consumer ownership, one-frame latency rules, and the banned C# event \u002F UnityEvent \u002F static bus anti-patterns. Use when input\u002FUI\u002Fnetwork must trigger ECS work, when a one-frame signal fans out to N consumers (damage, hit, collision), or when state changes must be processed exactly once.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-event-driven-ecs\u002FSKILL.md",[],[161,162,82,163,164,96,165,166,167,98,76,168,169,93,170,171,102,172,173,174],"event driven","driven","event","dots event driven ecs","change","ui","network","command","anti-patterns","pattern","structural","events","static","request",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":192,"publishedAt":31},"01M6KH4BWRGCEBJ8PKCKCSGT33","valid_skill","A complete, well-formed test fixture skill for SkillHub validation testing. Covers basic task routing and code review for Unity projects.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid_skill\u002FSKILL.md",[181,186,189],{"categoryNo":182,"categoryName":183,"taxonomyType":184,"taxonomyTypeDesc":185},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":187,"categoryName":188,"taxonomyType":184,"taxonomyTypeDesc":185},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":190,"categoryName":191,"taxonomyType":184,"taxonomyTypeDesc":185},"01JBSEEDCAT000000000000023","Skill与智能体开发",[193,194,195,196,197,198,199,200,201,202,203,204,205,206,150,207,152],"valid skill","valid","code review","testing","review","test","routing","code","validation","projects","fixture skill","task","fixture","basic","complete"]