# Milestone 6: C Layer - descriptor

[TOC]

*   [x] REFRESH: Review all documents in @perl/doc/guidelines/**

*   **perl/xs/descriptor/base.h:**
    *   [x] Create test file `perl/t/c/descriptor/base.c`.
    *   [ ] Tests cover all public functions in the corresponding .h file. (TODO stub created).
    *   [ ] TODO: Implement lazy descriptor blessing with thread-local fast-path. (Difficulty: 5/10).
    *   [ ] TODO: Implement schema fingerprinting for MessageDef comparison. (Difficulty: 4/10).
    *   [ ] TODO: Define test with descriptors from two different pools referencing each other. (Difficulty: 2/10).
    *   [ ] TODO: Verify upb's behavior and error handling for cross-pool references. (Difficulty: 3/10).
    *   [ ] TODO: Implement XS-level guards to prevent unsafe cross-pool resolution. (Difficulty: 2/10).
    *   [x] Implement C logic (Header-only macros for caching/blessing).
    *   [ ] C tests pass.

*   **Engineering Excellence (Reach for More):**
    *   [ ] TODO: Design API for batch field name to field descriptor resolution. (Difficulty: 3/10).
    *   [ ] TODO: Implement vectorized lookup using SIMD if applicable or efficient hashing. (Difficulty: 3/10).
    *   [ ] TODO: Benchmark bulk mapping vs individual lookups. (Difficulty: 2/10).
    *   [ ] TODO: Create a persistent index of descriptors in a shared memory segment. (Difficulty: 3/10).
    *   [ ] TODO: Implement O(1) lookup logic using the shared memory index. (Difficulty: 3/10).
    *   [ ] TODO: Handle index invalidation and updates when schemas change. (Difficulty: 2/10).
    *   [ ] TODO: Design mechanism to update an object's descriptor pointer at runtime. (Difficulty: 3/10).
    *   [ ] TODO: Ensure data layout compatibility between old and new descriptors. (Difficulty: 3/10).
    *   [ ] TODO: Implement re-dispatch logic to use the new schema for existing objects. (Difficulty: 3/10).
    *   [ ] TODO: Test hot-patching with active objects in a multi-threaded environment. (Difficulty: 3/10).
*   **perl/xs/descriptor/message.c:**
    *   [x] Create test file `perl/t/c/descriptor/message.c`.
    *   [x] Tests cover all public functions in the corresponding .h file. (Verified basic property access).
    *   [x] Implement C functions.
    *   [x] C tests pass.
*   **perl/xs/descriptor/field.c:**
    *   [x] Create test file `perl/t/c/descriptor/field.c`.
    *   [x] Tests cover all public functions in the corresponding .h file. (Verified basic property access).
    *   [x] Implement C functions.
    *   [x] C tests pass.
*   **perl/xs/descriptor/enum.c:**
    *   [x] Create test file `perl/t/c/descriptor/enum.c`.
    *   [ ] Tests cover all public functions in the corresponding .h file. (TODO stub created).
    *   [x] Implement C functions.
    *   [ ] C tests pass.
*   **perl/xs/descriptor/enum_value.c:**
    *   [x] Create test file `perl/t/c/descriptor/enum_value.c`.
    *   [ ] Tests cover all public functions in the corresponding .h file. (TODO stub created).
    *   [x] Implement C functions.
    *   [ ] C tests pass.
*   **perl/xs/descriptor/oneof.c:**
    *   [x] Create test file `perl/t/c/descriptor/oneof.c`.
    *   [ ] Tests cover all public functions in the corresponding .h file. (TODO stub created).
    *   [x] Implement C functions.
    *   [ ] C tests pass.
*   **perl/xs/descriptor/file.c:**
    *   [x] Create test file `perl/t/c/descriptor/file.c`.
    *   [ ] Tests cover all public functions in the corresponding .h file. (TODO stub created).
    *   [x] Implement C functions.
    *   [ ] C tests pass.
*   **perl/xs/descriptor/service.c:**
    *   [x] Create test file `perl/t/c/descriptor/service.c`.
    *   [ ] Tests cover all public functions in the corresponding .h file. (TODO stub created).
    *   [x] Implement C functions.
    *   [ ] C tests pass.
*   **perl/xs/descriptor/method.c:**
    *   [x] Create test file `perl/t/c/descriptor/method.c`.
    *   [ ] Tests cover all public functions in the corresponding .h file. (TODO stub created).
    *   [x] Implement C functions.
    *   [ ] C tests pass.
*   [x] Review and update perl/doc/architecture/** documents based on this milestone's learnings.
] Review and update perl/doc/architecture/** documents based on this milestone's learnings.
