Skip to content

feat: extend LiteralSet lowering with float and runtime support#260

Draft
m-akhil-reddy wants to merge 2 commits intoarxlang:mainfrom
m-akhil-reddy:feat/literal-set-clean
Draft

feat: extend LiteralSet lowering with float and runtime support#260
m-akhil-reddy wants to merge 2 commits intoarxlang:mainfrom
m-akhil-reddy:feat/literal-set-clean

Conversation

@m-akhil-reddy
Copy link
Copy Markdown
Contributor

Notes

  • This repository uses an AI bot for reviews. Keep your PR in Draft while
    you work. When you’re ready for a review, change the status to Ready for
    review
    to trigger a new review round. If you make additional changes and
    don’t want to trigger the bot, switch the PR back to Draft.
  • AI-bot comments may not always be accurate. Please review them critically and
    share your feedback; it helps us improve the tool.
  • Avoid changing code that is unrelated to your proposal. Keep your PR as short
    as possible to increase the chances of a timely review. Large PRs may not be
    reviewed and may be closed.
  • Don’t add unnecessary comments. Your code should be readable and
    self-documenting
    (guidance).
  • Don’t change core features without prior discussion with the community. Use
    our Discord to discuss ideas, blockers, or issues
    (https://discord.gg/Nu4MdGj9jB).
  • Do not include secrets (API keys, tokens, passwords), credentials, or
    sensitive data/PII in code, configs, logs, screenshots, or commit history. If
    something leaks, rotate the credentials immediately, invalidate the old key,
    and note it in the PR so maintainers can assist.
  • Do not commit large binaries or generated artifacts. If large datasets are
    needed for tests, prefer small fixtures or programmatic downloads declared in
    makim.yaml (e.g., a task that fetches data at test time). If a large binary is
    unavoidable, discuss first and consider Git LFS.

Pull Request description

#224

How to test these changes

  • ...

Pull Request checklists

This PR is a:

  • bug-fix
  • new feature
  • maintenance

About this PR:

  • it includes tests.
  • the tests are executed on CI.
  • the tests generate log file(s) (path).
  • pre-commit hooks were executed locally.
  • this PR requires a project documentation update.

Author's checklist:

  • I have reviewed the changes and it contains no misspelling.
  • The code is well commented, especially in the parts that contain more
    complexity.
  • New and old tests passed locally.

Additional information

Reviewer's checklist

Copy and paste this template for your review's note:

## Reviewer's Checklist

- [ ] I managed to reproduce the problem locally from the `main` branch
- [ ] I managed to test the new changes locally
- [ ] I confirm that the issues mentioned were fixed/resolved .

@m-akhil-reddy
Copy link
Copy Markdown
Contributor Author

hi @yuvimittal ,
i have made PR related to set :-

Summary of what was done:

  • Extended LiteralSet lowering to support homogeneous float constant sets
  • Improved mixed-width integer handling with proper type promotion
  • Added runtime lowering for non-constant integer sets using alloca + store
  • Fixed unsafe builder context access by using builder.block instead of builder.function

Added tests covering:

  • Added tests for float support and runtime lowering
  • Ensured all tests pass and follow project conventions

@m-akhil-reddy
Copy link
Copy Markdown
Contributor Author

@yuvimittal , can you please review this PR.

assert isinstance(const, ir.Constant)
assert isinstance(const.type, ir.ArrayType)
assert const.type.count == EXPECTED_SET_LENGTH
assert isinstance(const.type.element, ir.FloatType)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

check output as well


# Verify structure of allocated array
assert isinstance(result.type.pointee, ir.ArrayType)
assert result.type.pointee.count == EXPECTED_SET_LENGTH
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

here also check output as well

@yuvimittal
Copy link
Copy Markdown
Member

@m-akhil-reddy , are you facing while making the test? few contributors are facing some issues while asserting the output?

@m-akhil-reddy m-akhil-reddy force-pushed the feat/literal-set-clean branch from cf1006a to 898f897 Compare March 30, 2026 05:17
@m-akhil-reddy
Copy link
Copy Markdown
Contributor Author

@yuvimittal , Updated tests to validate output values in a format-independent way and verified runtime lowering through emitted IR instructions.

@xmnlab
Copy link
Copy Markdown
Contributor

xmnlab commented Apr 1, 2026

@m-akhil-reddy please rebase this branch on top of the upstream main

@xmnlab xmnlab marked this pull request as draft April 1, 2026 04:54
@m-akhil-reddy m-akhil-reddy force-pushed the feat/literal-set-clean branch from 5c5bdff to 350ec45 Compare April 2, 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