Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix failing inot test #1841

Merged
merged 2 commits into from
Jan 7, 2025
Merged

test: Fix failing inot test #1841

merged 2 commits into from
Jan 7, 2025

Conversation

croyzor
Copy link
Contributor

@croyzor croyzor commented Jan 7, 2025

The !1 = 0 test doesn't work because the ints it's run on are more than 1 bit wide. I tried reducing the width but it seems the hugr-llvm conversion isn't faithful, downcasting smaller int types to u8, meaning !1 would be 254

@croyzor croyzor requested a review from ss2165 January 7, 2025 09:19
@croyzor croyzor requested a review from a team as a code owner January 7, 2025 09:19
@@ -463,7 +463,7 @@ mod test {
#[rstest]
// LHS: Most significant bit (2^63), RHS: All the other bits combined
#[case::inot("inot", 9223372036854775808, 9223372036854775807)]
#[case::inot("inot", 1, 0)]
#[case::inot("inot", 18446744073709551615, 0)]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[case::inot("inot", 18446744073709551615, 0)]
#[case::inot("inot", !0u64, 0)]

All I'm after is something easy to verify by eye really

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😮

@croyzor croyzor changed the title tests: Fix failing inot test test: Fix failing inot test Jan 7, 2025
@croyzor croyzor added this pull request to the merge queue Jan 7, 2025
Merged via the queue into main with commit 09cbc6a Jan 7, 2025
19 of 20 checks passed
@croyzor croyzor deleted the tests/fix-not branch January 7, 2025 10:30
@hugrbot hugrbot mentioned this pull request Jan 7, 2025
@hugrbot hugrbot mentioned this pull request Jan 16, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jan 20, 2025
## 🤖 New release
* `hugr`: 0.14.1 -> 0.14.2 (✓ API compatible changes)
* `hugr-core`: 0.14.1 -> 0.14.2 (✓ API compatible changes)
* `hugr-model`: 0.16.0 -> 0.17.0 (⚠️ API breaking changes)
* `hugr-llvm`: 0.14.1 -> 0.14.2 (✓ API compatible changes)
* `hugr-passes`: 0.14.1 -> 0.14.2 (✓ API compatible changes)
* `hugr-cli`: 0.14.1 -> 0.14.2 (✓ API compatible changes)

### ⚠️ `hugr-model` breaking changes

```
--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.38.0/src/lints/enum_variant_added.ron

Failed in:
  variant Term:Const in /tmp/.tmpszSQ4r/hugr/hugr-model/src/v0/mod.rs:591
  variant Term:ConstFunc in /tmp/.tmpszSQ4r/hugr/hugr-model/src/v0/mod.rs:697
  variant Term:ConstAdt in /tmp/.tmpszSQ4r/hugr/hugr-model/src/v0/mod.rs:703
  variant Term:Bytes in /tmp/.tmpszSQ4r/hugr/hugr-model/src/v0/mod.rs:711
  variant Term:BytesType in /tmp/.tmpszSQ4r/hugr/hugr-model/src/v0/mod.rs:717
  variant Term:Meta in /tmp/.tmpszSQ4r/hugr/hugr-model/src/v0/mod.rs:720
  variant Operation:Const in /tmp/.tmpszSQ4r/hugr/hugr-model/src/v0/mod.rs:409

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.38.0/src/lints/enum_variant_missing.ron

Failed in:
  variant Term::Quote, previously in file /tmp/.tmp8fke0a/hugr-model/src/v0/mod.rs:565

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.38.0/src/lints/struct_missing.ron

Failed in:
  struct hugr_model::v0::MetaItem, previously in file /tmp/.tmp8fke0a/hugr-model/src/v0/mod.rs:500
```

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr`
<blockquote>

##
[0.14.2](hugr-v0.14.1...hugr-v0.14.2)
- 2025-01-20

### Bug Fixes

- Three bugfixes in model import and export. (#1844)

### Documentation

- Fix typo in `DataflowParent` doc (#1865)

### New Features

- Add CallGraph struct, and dead-function-removal pass (#1796)
- `Value::some`, `::none`, and `SumType::new_option` helpers (#1828)
- Constant values in `hugr-model` (#1838)
- *(hugr-llvm)* Emit ipow (#1839)
- Bytes literal in hugr-model. (#1845)
- Improved representation for metadata in `hugr-model` (#1849)

### Testing

- Add tests for constant value deserialization (#1822)
</blockquote>

## `hugr-core`
<blockquote>

##
[0.14.2](hugr-core-v0.14.1...hugr-core-v0.14.2)
- 2025-01-20

### Bug Fixes

- Three bugfixes in model import and export. (#1844)

### Documentation

- Fix typo in `DataflowParent` doc (#1865)

### New Features

- `Value::some`, `::none`, and `SumType::new_option` helpers (#1828)
- Constant values in `hugr-model` (#1838)
- *(hugr-llvm)* Emit ipow (#1839)
- Bytes literal in hugr-model. (#1845)
- Improved representation for metadata in `hugr-model` (#1849)

### Testing

- Add tests for constant value deserialization (#1822)
</blockquote>

## `hugr-model`
<blockquote>

##
[0.17.0](hugr-model-v0.16.0...hugr-model-v0.17.0)
- 2025-01-20

### Bug Fixes

- Three bugfixes in model import and export. (#1844)

### New Features

- Constant values in `hugr-model` (#1838)
- Bytes literal in hugr-model. (#1845)
- Improved representation for metadata in `hugr-model` (#1849)
</blockquote>

## `hugr-llvm`
<blockquote>

##
[0.14.2](hugr-llvm-v0.14.1...hugr-llvm-v0.14.2)
- 2025-01-20

### New Features

- *(hugr-llvm)* Emit more int ops (#1835)
- Constant values in `hugr-model` (#1838)
- *(hugr-llvm)* Emit ipow (#1839)

### Refactor

- *(hugr-llvm)* [**breaking**] Optimise the llvm types used to represent
hugr sums. (#1855)

### Testing

- Fix failing inot test (#1841)
</blockquote>

## `hugr-passes`
<blockquote>

##
[0.14.2](hugr-passes-v0.14.1...hugr-passes-v0.14.2)
- 2025-01-20

### New Features

- Add CallGraph struct, and dead-function-removal pass (#1796)
</blockquote>

## `hugr-cli`
<blockquote>

##
[0.14.1](hugr-cli-v0.14.0...hugr-cli-v0.14.1)
- 2024-12-18

### New Features

- Print `hugr-cli`'s correct version when using '--version' (#1790)
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: Agustín Borgna <agustin.borgna@quantinuum.com>
@hugrbot hugrbot mentioned this pull request Jan 20, 2025
@hugrbot hugrbot mentioned this pull request Feb 5, 2025
github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2025
## 🤖 New release

* `hugr`: 0.14.3
* `hugr-core`: 0.14.3
* `hugr-model`: 0.17.1
* `hugr-llvm`: 0.14.3
* `hugr-passes`: 0.14.3
* `hugr-cli`: 0.14.3

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr`

<blockquote>

##
[0.14.3](hugr-v0.14.2...hugr-v0.14.3)
- 2025-02-05

### Bug Fixes

- Export `RemoveDeadFuncsError` (#1883)
- const-folding Module keeps at least "main" (#1901)
- determine correct bounds of custom types (#1888)
- Exporting converging control flow edges (#1890)

### Documentation

- Fix deprecation warning messages (#1891)
- Explain why `ConstF64` is not PartialEq (#1829)

### New Features

- Special cased array, float and int constants in hugr-model export
(#1857)
- Simplify hugr-model (#1893)
</blockquote>

## `hugr-core`

<blockquote>

##
[0.14.3](hugr-core-v0.14.2...hugr-core-v0.14.3)
- 2025-02-05

### Bug Fixes

- determine correct bounds of custom types (#1888)
- Exporting converging control flow edges (#1890)

### Documentation

- Explain why `ConstF64` is not PartialEq (#1829)

### New Features

- Special cased array, float and int constants in hugr-model export
(#1857)
- Simplify hugr-model (#1893)
</blockquote>

## `hugr-model`

<blockquote>

##
[0.17.1](hugr-model-v0.17.0...hugr-model-v0.17.1)
- 2025-02-05

### Bug Fixes

- determine correct bounds of custom types (#1888)

### New Features

- Special cased array, float and int constants in hugr-model export
(#1857)
- Simplify hugr-model (#1893)
- Do not require `capnp` to be installed to compile `hugr-model` (#1907)
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.14.2](hugr-llvm-v0.14.1...hugr-llvm-v0.14.2)
- 2025-01-20

### New Features

- *(hugr-llvm)* Emit more int ops (#1835)
- Constant values in `hugr-model` (#1838)
- *(hugr-llvm)* Emit ipow (#1839)

### Refactor

- *(hugr-llvm)* [**breaking**] Optimise the llvm types used to represent
hugr sums. (#1855)

### Testing

- Fix failing inot test (#1841)
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.14.3](hugr-passes-v0.14.2...hugr-passes-v0.14.3)
- 2025-02-05

### Bug Fixes

- Export `RemoveDeadFuncsError` (#1883)
- const-folding Module keeps at least "main" (#1901)

### Documentation

- Fix deprecation warning messages (#1891)
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.14.1](hugr-cli-v0.14.0...hugr-cli-v0.14.1)
- 2024-12-18

### New Features

- Print `hugr-cli`'s correct version when using '--version' (#1790)
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: Agustín Borgna <agustin.borgna@quantinuum.com>
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