Skip to content

Implement validate_tables: sorted table verification and Ptr table checks#62

Merged
AaronRobinsonMSFT merged 8 commits intomasterfrom
copilot/implement-validate-tables-todos
Feb 15, 2026
Merged

Implement validate_tables: sorted table verification and Ptr table checks#62
AaronRobinsonMSFT merged 8 commits intomasterfrom
copilot/implement-validate-tables-todos

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

  • Add mdc_uncompressed_table_heap flag to mdcxt_flag_t in internal.h
  • Set the flag in md_create_handle in entry.c when tables_heap_uncompressed is true
  • Set the flag in create_and_fill_indirect_table in editor.c when Ptr tables are introduced via edit APIs
  • Use mdc_uncompressed_table_heap flag in md_write_to_buffer for #- stream name selection instead of mdc_minimal_delta
  • Implement validate_tables in streams.c:
    • Validate that *Ptr tables (FieldPtr, MethodPtr, ParamPtr, EventPtr, PropertyPtr) are not present in a compressed table heap (#~)
    • Validate that tables marked as sorted are actually sorted (using sort keys from get_table_keys)
  • Align equals signs in mdcxt_flag_t enum
  • Restore ECMA-335 TODO comment
  • Build and test (all 30 emit tests pass)
Original prompt

Implement the TODOs in the validate_tables method.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits February 14, 2026 02:19
…e check

- Add mdc_uncompressed_table_heap flag to track #- vs #~ table heap
- Set the flag in md_create_handle when tables_heap_uncompressed is true
- Validate that *Ptr tables are not present in compressed (#~) table heaps
- Validate that tables marked as sorted are actually sorted by their keys

Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement TODOs in validate_tables method Implement validate_tables: sorted table verification and Ptr table checks Feb 14, 2026
Copilot AI requested a review from jkoritzinsky February 14, 2026 02:26
…t APIs

Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
@jkoritzinsky
Copy link
Collaborator

@copilot update the logic in md_write_to_buffer to use the #- stream based on the new uncompressed flag you added instead of the minimal delta flag.

Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 14, 2026

@copilot update the logic in md_write_to_buffer to use the #- stream based on the new uncompressed flag you added instead of the minimal delta flag.

Done in 6f95ee2md_write_to_buffer now uses mdc_uncompressed_table_heap to choose between #- and #~ for the table stream name. The mdc_minimal_delta check is kept only for the #JTD stream count increment. The redundant indirect table loop check was also removed since the flag already covers that case.

Copy link
Collaborator

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Please implement this feedback

…pdate Ptr comment

Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 15, 2026

@copilot Please implement this feedback

All three items addressed in 6e3ee0c — enum alignment, restored ECMA-335 TODO, and updated Ptr comment.

@jkoritzinsky jkoritzinsky marked this pull request as ready for review February 15, 2026 01:21
@AaronRobinsonMSFT AaronRobinsonMSFT merged commit dcf6115 into master Feb 15, 2026
13 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the copilot/implement-validate-tables-todos branch February 15, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants