sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Cycle detected while trying to transmute future
Labels: T-compiler,C-bug,S-has-mcve,I-cycle

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code:

```rust
use std::mem::MaybeUninit;

fn main() {
    let fut = async {};
    let cast: [MaybeUninit<u8>; 1] = unsafe { std::mem::transmute(fut) };
}
```

I was playing around and expected this to succeed, instead, it resulted in this: 

```rust
error[E0391]: cycle detected when type-checking `main`
 --> src/main.rs:3:1
  |
3 | fn main() {
  | ^^^^^^^^^
  |
  = note: ...which requires computing layout of `{async block@src/main.rs:4:15: 4:23}`...
note: ...which requires optimizing MIR for `main::{closure#0}`...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
note: ...which requires elaborating drops for `main::{closure#0}`...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
note: ...which requires coroutine witness types for `main::{closure#0}`...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
note: ...which requires promoting constants in MIR for `main::{closure#0}`...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
note: ...which requires checking if `main::{closure#0}` contains FFI-unwind calls...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
note: ...which requires building MIR for `main::{closure#0}`...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
note: ...which requires match-checking `main::{closure#0}`...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
note: ...which requires type-checking `main::{closure#0}`...
 --> src/main.rs:4:15
  |
4 |     let fut = async {};
  |               ^^^^^^^^
  = note: ...which again requires type-checking `main`, completing the cycle
  = note: cycle used when running analysis passes on this crate
  = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.80.0-nightly (87293c958 2024-05-08)
binary: rustc
commit-hash: 87293c9585a7fb2cc83ca9949ae79661d5d3c31a
commit-date: 2024-05-08
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->

<p>

</p>
</details>
Repository: pytorch
Issue: `WeightedRandomSampler` convert weights `dtype=torch.double` internally but `MPS` only support  `dtype=torch.float32`
Labels: module: dataloader,triaged,module: mps

### 🐛 Describe the bug

```python
if classification:
        train_indices = indices[:train_size]
        train_targets = [np.array(dataset[i][1].numpy(),
                                  dtype=np.int32).item() for i in train_indices]
        class_weights = compute_class_weight(
            class_weight = 'balanced',
            classes = np.unique(train_targets),
            y = train_targets)
        class_weights = class_weights/np.linalg.norm(class_weights)
        loss_weights = torch.tensor(class_weights, dtype=torch.float32)
        class_weights_dict = {class_idx: weight for class_idx,
                              weight in zip(np.unique(train_targets), class_weights)}
        class_weights_tensor = torch.tensor([class_weights_dict[class_idx]
                                             for class_idx in train_targets], dtype=torch.float32)
        train_sampler = WeightedRandomSampler(
            weights = class_weights_tensor[train_indices],
            num_samples = train_size,
            replacement = False)
```

```
  File "/python3.10/site-packages/torch/utils/data/sampler.py", line 227, in __init__
    weights_tensor = torch.as_tensor(weights, dtype=torch.double)
  File "/python3.10/site-packages/torch/utils/_device.py", line 77, in __torch_function__
    return func(*args, **kwargs)
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.
```

### Versions

```
PyTorch version: 2.2.2
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 14.4.1 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: version 3.29.3
Libc version: N/A

Python version: 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:51:49) [Clang 16.0.6 ] (64-bit runtime)
Python platform: macOS-14.4.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M2

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] torch==2.2.2
[pip3] torchvision==0.17.2
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] torch                     2.2.2                    pypi_0    pypi
[conda] torchvision               0.17.2                   pypi_0    pypi
```

cc @andrewkho @gokulavasan @SsnL @VitalyFedyunin @dzhulgakov @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen @mruberry @jbschlosser @walterddr @mikaylagawarecki
Repository: transformers
Issue: Mixtral past_key_values and output_router_logits incompatible
Labels: Good Second Issue

### System Info

transformers==4.40.2
Python 3.11.8


### Who can help?

@ArthurZucker 

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

```python
from transformers import MixtralConfig, MixtralForCausalLM, AutoTokenizer
import torch
# Initializing a smaller version of Mixtral for faster execution
configuration = MixtralConfig(
    hidden_size=256,
    intermediate_size=896,
    num_hidden_layers=8,
    num_attention_heads=8,
    num_key_value_heads=8,
    num_local_experts=4,
    num_experts_per_tok=1,
)

model = MixtralForCausalLM(configuration)
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mixtral-8x7B-v0.1")
prompt = "This is a test"
tokenized = tokenizer(prompt, return_tensors="pt")
output = model(**tokenized, output_router_logits=True)
key_values = output.past_key_values
logits = output.logits
next_token_logits = logits[..., -1, :]
# Softmax
softmaxed = torch.nn.functional.softmax(next_token_logits, dim=-1)
# Sample
sampled = torch.multinomial(softmaxed.squeeze(), num_samples=1)
ids = sampled.item()

attention_mask = torch.cat([tokenized["attention_mask"], torch.tensor([[1]])], dim=-1)
next_output = model(
    torch.tensor([[ids]]),
    attention_mask=attention_mask,
    past_key_values=key_values,
    output_router_logits=True
)
```

### Expected behavior

It seems that this is the same underlying issue as in #29087 - I would expect `past_key_values` to work with `output_router_logits`. 
So what happens?
1. Without past key values (and with multiple input ids) the `all_router_logits` has the proper sequence length, thus in `load_balancing_loss_func` this `num_hidden_layers = concatenated_gate_logits.shape[0] // (batch_size * sequence_length)` correctly evaluates the number of hidden layers.
2. If past key values are used, `all_router_logits` has a sequence length of 1, but since the attention mask is still the whole sequence (from which the `sequence_length` is inferred) the hidden layers evaluate to a small value or 0, leading to the same error as in #29087

Instead, I would like the `load_balancing_loss_func` to be able to deal with a case where the `gate_logits` passed are of shape `[batch_size X 1, num_experts]` instead of `[batch_size X sequence_length, num_experts]`.
Repository: tauri
Issue: [bug] Drag-and-Drop doesn't handled properly on Linux
Labels: type: bug,status: upstream,status: needs triage

### Describe the bug

As far as we know, by default, Tauri handles drag-n-drop via its own `tauri://drop` and related events.

While in Linux (both Ubuntu 22.04 and 24.04), once a file is dropped onto the window, an `tauri://drag-cancelled` is emitted instead, and the webview is unexpectedly navigated to the dropped file.

### Reproduction

Link: https://github.com/xingrz/tauri-v2-drag-n-drop

1. Run the demo
2. Open the Web Inspector, and switch to `Console` tab. Enable `Preserve Log`
   <img width="273" alt="image" src="https://github.com/tauri-apps/tauri/assets/288288/9dcc4dd3-fd75-4065-b329-6549d5b3ecda">
3. Drag and drop some file(s) onto the window

<img width="871" alt="image" src="https://github.com/tauri-apps/tauri/assets/288288/c67ef0e0-d073-4d53-ae05-5a76dee0eda4">

As its shown in the screenshot below, `tauri://drag-cancelled` is emitted, and the webview is navigated to the file (`package.json`) just dropped.

### Expected behavior

<img width="903" alt="image" src="https://github.com/tauri-apps/tauri/assets/288288/ae5d9caf-4b15-4e74-82a7-295ef6e1d80e">

A `tauri://drop` should be emitted. In the above minimal reproduction, size of the dropped file is displayed.

### Full `tauri info` output

```text
$ npm run tauri info

> tauri-v2-drag-n-drop@0.0.0 tauri
> tauri info


[✔] Environment
    - OS: Ubuntu 24.04 X64
    ✔ webkit2gtk-4.1: 2.44.0
    ✔ rsvg2: 2.58.0
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-unknown-linux-gnu (default)
    - node: 20.13.0
    - npm: 10.5.2

[-] Packages
    - tauri [RUST]: 2.0.0-beta.18
    - tauri-build [RUST]: 2.0.0-beta.14
    - wry [RUST]: 0.39.4
    - tao [RUST]: 0.27.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.11
    - @tauri-apps/cli [NPM]: 2.0.0-beta.16

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite
```


### Stack trace

_No response_

### Additional context

_No response_
Repository: godot
Issue: `draw_rect` with `filled` set to false randomly disappears on camera zoom in/out
Labels: discussion,topic:rendering,documentation,topic:2d

### Tested versions

- Godot 4.2.2.stable

### System information

Mac OS , Web , Compatibility Renderer,  Forward + 

### Issue description

This issue concerns the unexpected disappearance of `draw_rect` shapes with the filled property set to `false` and a `width` of `1.0` ( happens with other values as well) in zooming the camera in or out. The problem occurs randomly and affects the visibility of the shapes.

**This affects tool scrips when zooming out/in in Editor as well as during Runtime with a custom camera** 

https://github.com/godotengine/godot/assets/27586088/592c2bce-272b-46b0-aff7-8a9e3ea1e84b



### Steps to reproduce

- create a Node2D scene and attach this script to it.


```gdscript
@tool
extends Node2D



func _draw():
	draw_rect(Rect2(Vector2.ONE * 10, Vector2.ONE * 200), Color.BLACK, false, 1.0)

```

- Open scene, Zoom out in editor

### Minimal reproduction project (MRP)

[draw_rect.zip](https://github.com/godotengine/godot/files/15323742/draw_rect.zip)
Repository: vscode
Issue: Support distinguishing workspace folders based on query param differences
Labels: feature-request,workbench-workspace

When using a multi-root workspace that has folders whose URIs differ only in query parameters, the sibling folders shown via breadcrumb select have the wrong names. When expanded, the folder contents are correct. Consider the following workspace:

```json
{
	"folders": [
		{
			"name": "abc",
			"uri": "isfs://iris:user/"
		},
		{
			"name": "def",
			"uri": "isfs://iris:user/?csp"
		}
	]
}
```

Expected behavior:
<img width="442" alt="Screenshot 2024-05-09 at 12 31 16 PM" src="https://github.com/microsoft/vscode/assets/44776135/dd44cc9c-771e-4b22-b3bd-9e18e82089f8">

Actual behavior:
<img width="457" alt="Screenshot 2024-05-09 at 12 30 51 PM" src="https://github.com/microsoft/vscode/assets/44776135/a759d6f4-a8c9-4aa4-90ed-939d102ea33c">

- VS Code Version: 1.89.0

See https://github.com/intersystems-community/vscode-objectscript/issues/1358
Repository: rust
Issue: Point at binding declaration on type and trait errors
Labels: A-diagnostics,T-compiler

### Code

```Rust
fn main() {
    let x = if true {
        "";
    } else {
        "";
    };
    println!("{x}");
    foo(x);
}
fn foo(_: &str) {
}
```


### Current output

```Shell
error[E0277]: `()` doesn't implement `std::fmt::Display`
 --> src/main.rs:7:15
  |
7 |     println!("{x}");
  |               ^^^ `()` cannot be formatted with the default formatter
  |
  = help: the trait `std::fmt::Display` is not implemented for `()`
  = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
  = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> src/main.rs:8:9
   |
8  |     foo(x);
   |     --- ^ expected `&str`, found `()`
   |     |
   |     arguments to this function are incorrect
   |
note: function defined here
  --> src/main.rs:10:4
   |
10 | fn foo(_: &str) {
   |    ^^^ -------
```


### Desired output

```Shell
error[E0277]: `()` doesn't implement `std::fmt::Display`
 --> src/main.rs:7:15
  |
2 |     let x = if true {
  |         - this binding has type `()`
...
7 |     println!("{x}");
  |               ^^^ `()` cannot be formatted with the default formatter
  |
  = help: the trait `std::fmt::Display` is not implemented for `()`
  = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
  = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> src/main.rs:8:9
   |
2  |     let x = if true {
   |         - this binding has type `()`
...
   |
8  |     foo(x);
   |     --- ^ expected `&str`, found `()`
   |     |
   |     arguments to this function are incorrect
   |
note: function defined here
  --> src/main.rs:10:4
   |
10 | fn foo(_: &str) {
   |    ^^^ -------
```


### Rationale and extra context

This is specially useful for cases where a binding has the unit type `()`, because that signals some kind of mistake on the declaration, but it can be useful in general. It might be better to make it a note, so it isn't the first thing people see, but we can iterate on the output after seeing how it works in practice.

### Other cases

_No response_

### Rust Version

```Shell
1.78
```


### Anything else?

_No response_

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"cardigan1008"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: ui
Issue: [bug]: Module not found: Error: Can't resolve '@/components/ui .......
Labels: bug

### Describe the bug

When using create react app and compiling / starting the react-scripts start command, you get 
Module not found: Error: Can't resolve '@/components/ui .......
Also found here:
https://github.com/shadcn-ui/ui/issues/1101#issuecomment-1998726992


### Affected component/components

all

### How to reproduce

create a react app by create react app (i added typescript)
add shadcn
create a component
run start script

### Codesandbox/StackBlitz link

_No response_

### Logs

_No response_

### System Info

```bash
(MacOS)(Chromium browser) Create React App
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: ollama
Issue: longtext llama3-gradient bug
Labels: bug

### What is the issue?

If I use 'ollama' for long text processing, then the 'system' statements will no longer be effective. Instead, it will produce random outputs. The model is 'llama3-gradient'.
```
systemmsg="""
Please analyze the type of website based on the 'body' content I provide, and return to me in JSON format with the structure {type:..., why:...}.
"""
def get_webpage_content(url):
    try:
        if response.status_code == 200:
            return response.text
        else:
            print(f'Failed to retrieve the webpage. Status code: {response.status_code}')
            return None
    except requests.exceptions.RequestException as e:
        print(f'An error occurred: {e}')
        return None

body = get_webpage_content('http://www.sohu.com')
response = ollama.generate(model='llama3-gradient', prompt=body,format='json',options={
    "seed": 123,
    "num_ctx": 32000
  },
  system=systemmsg)
print(response['response'])
```
### OS

Windows

### GPU

Nvidia

### CPU

Intel

### Ollama version

0.1.34
Repository: flutter
Issue: Move "Flutter iOS PlatformView (Engine) Overview" design doc to markdown in engine
Labels: engine,P2,team-ios,triaged-ios

The [Flutter iOS PlatformView (Engine) Overview](https://docs.flutter.dev/go/ios-platform-view-engine-overview) design doc is a useful description of how iOS platform views work.  Copy it into a markdown file in [docs/](https://github.com/flutter/engine/blob/main/docs) or another appropriate location.

This request is a product of the https://flutter.dev/go/migrate-flutter-wiki effort, and realizing https://github.com/flutter/flutter/wiki/Hybrid-Composition-iOS was a less-detailed/older version of that design doc, but ideally the design would live next to the code, to be updated as the implementation details change.
Repository: PowerToys
Issue: Jumpy mouse movement when looking at the shortcut guide
Labels: Issue-Bug,Needs-Repro

### Microsoft PowerToys version

0.80.1

### Installation method

WinGet

### Running as admin

Yes

### Area(s) with issue?

Shortcut Guide

### Steps to reproduce

1: Press the shortcut to open the Shortcut Guide
2: Move the mouse around
3: The mouse movement is jumpy. This affects both monitors

https://github.com/microsoft/PowerToys/assets/81916167/60333a0d-9646-46ed-af69-8d29c23a1e26

[PowerToysReport_2024-05-09-18-31-41.zip](https://github.com/microsoft/PowerToys/files/15265624/PowerToysReport_2024-05-09-18-31-41.zip)



### ✔️ Expected Behavior

Smooth mouse movement

### ❌ Actual Behavior

Jumpy mouse movement

### Other Software

_No response_
Repository: node
Issue: Timeline for V8 fast-calls header exposed for native addons?
Labels: feature request

### What is the problem this feature will solve?

Fast calls in V8 was introduced 4 years ago, soon to be half a decade ago. These features are still not exposed to native addon authors due to "it may change"-argumentation (see previous threads).

When can these features be freely used by the ecosystem as they see fit? Are we supposed to wait half a decade more? There clearly are many useful cases where it dramatically helps performance.

Why not just let the ecosystem adopt them as they see usable? We already have gone through 10+ years of V8 breaking API changes from version to version so none of this is news to any of us making native addons - V8 has never been stable in its API, not even the early wrappers were ever stable.

It always changed over time, so to treat fast calls differently than any other potential API change makes no sense. Esp. when it holds back performance innovation that technically already is available.

### What is the feature you are proposing to solve the problem?

To include the v8-fast-api-calls.h so that native addons can use them.

### What alternatives have you considered?

Hacking it in myself, on my own end
Repository: godot
Issue: Inspector: reordering color swatches in color picker is not saved after closing popup
Labels: bug,topic:editor

### Tested versions

- Reproducible in v4.2.1.stable.official [b09f793f5]

### System information

Godot v4.2.1.stable - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 860M (nvidia; 535.161.07) - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)

### Issue description

I added my color swatches in the wrong order and I'm trying to reorder them.

But after closing the color picker popup and reopening it, the old order is restored.

### Steps to reproduce

[Peek 2024-05-09 Reorder color swatch not saved.webm](https://github.com/godotengine/godot/assets/1067772/8dd6bb79-9c98-4e20-9374-e9eb27435e21)

1. Add some node with color property (any Node2D will do, thx to Modulate)
2. Add some colors to swatches
3. Move swatches around to reorder them
4. Close and reorder color picker

### Minimal reproduction project (MRP)

N/A
Repository: flutter
Issue: [CupertinoIcons] move the font generation script and the codepoint map into the `cupertino_icons` repo/package
Labels: tool,framework,f: cupertino,P2,p: cupertino_icons,team-design,triaged-design

### The contents of the [cupertino_icons generation repo](https://github.com/xster/framework7-icons) should be moved to flutter/packages 

Per the comments [here](https://github.com/xster/framework7-icons/pull/2#issuecomment-2080368499).

### The [generated dart file](https://github.com/xster/framework7-icons/blob/master/build/cupertino_generated_icons.dart) should be distributed as part of the `cupertino_icons` package

Currently the generated dart file is part of the `cupertino` library instead of the `cupertino_icons` package. With the font and the codepoint map living in different packages, there doesn't seem to be a way to properly version the dart codepoint binding, or to test it. Example: I would like to fix an incorrectly mapped codepoint in `cupertino_icons < 1.08` but since the dart file lives in `cupertino` it would break code that's using older versions (https://github.com/flutter/flutter/pull/146806/files#diff-6622a57feb8a0b6d1674c2cad83821872010e3c8005be91079c3d34d466a0f91)

This could be a breaking change but not doing it is kinda bad too because we can't fix incorrect codepoints without breaking apps that are using older versions of `cupertino_icons`.