Skip to content

Conversation

Copy link

Copilot AI commented Dec 28, 2025

PR #290 introduced NameError by calling three undefined functions (reset_errors(), get_translation_engine(), get_error_collector()) in the translation path. This breaks all translation operations.

Changes

  • Removed incomplete modern translation engine fallback (24 lines in _crosstl.py)

    • Deleted calls to reset_errors(), get_translation_engine(), and get_error_collector()
    • Removed try-except wrapper around non-existent engine
  • Preserved all PR Remove Redundancy with base infrastructure #290 improvements

    • Centralized type mappings in crosstl/utils/type_mappings.py
    • AST utilities in crosstl/utils/ast_utils.py
    • Enhanced CLI and improved code organization

Impact

Translation now works without runtime errors:

from crosstl._crosstl import translate
# Previously: NameError: name 'reset_errors' is not defined
# Now: Works correctly
result = translate('shader.cgl', 'metal')

All backend type mappings (cuda, metal, directx, etc.) remain functional.

Original prompt

Pull Request: #290


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Remove incomplete modern translation engine code that references
undefined functions: reset_errors(), get_translation_engine(), and
get_error_collector(). Keep the working legacy translation system.

Co-authored-by: NripeshN <86844847+NripeshN@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues in pull request 290 Fix undefined function calls in _crosstl.py from PR #290 Dec 28, 2025
Copilot AI requested a review from NripeshN December 28, 2025 06:50
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.

2 participants