sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Collect lang items on the AST instead of HIR
Labels: C-cleanup,E-mentor,T-compiler,E-help-wanted,E-medium,A-lang-item,A-ast

Lang items are collected on HIR in `rustc_passes::lang_items`.
However, AST -> HIR lowering may need to know of some lang items, for instance for loops of async desugaring.
Having lang items ready before lowering may simplify those code paths.

This requires re-implementing lang item collection on AST instead of HIR.
The simplest way is to make `rustc_passes::lang_items::LanguageItemCollector` a `rustc_ast::Visitor`, and have `get_lang_items` use it to visit the full crate. The AST is accessible using the second field of `tcx.resolver_for_lowering(()).borrow()`.

A statement `tcx.ensure_with_value().get_lang_items(LOCAL_CRATE)` needs to be added at the top of `rustc_ast_lowering::lower_to_hir` to ensure that the computation is done before dropping the AST.

Once that is done, `hir::QPath::LangItem` and `hir::GenericBound::LangItemTrait` variants can be removed from HIR, replaced by actual resolutions of the lang items. (For particular cases, see how those variants are constructed and used.)

Please contact me on zulip for any question.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

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

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: deno
Issue: streamed uploads with fetch, including content-length shouldn't use transfer-encoding chunked
Labels: bug

needs to error if stream length doesn't match content-length.


ref https://github.com/denoland/deno/pull/19969
Repository: storybook
Issue: [Bug]: Vue renderer > Stories source block breaks with custom decorators
Labels: bug,needs triage

### Describe the bug

When stories use custom decorators in a Vue Storybook, the code block doesn't render properly.

Instead of showing the Vue template, the block renders the story's own code:


| Expected | Actual |
| --- | --- |
| <img width="882" alt="Screenshot 2023-08-24 at 7 12 48 PM" src="https://github.com/storybookjs/storybook/assets/4895885/f9aa4525-8820-4439-a206-0c87ea18f86b"> | <img width="879" alt="Screenshot 2023-08-24 at 7 11 59 PM" src="https://github.com/storybookjs/storybook/assets/4895885/45e38088-6afe-41e4-a034-6f6e70c35c91"> |




### To Reproduce

1. Start a Vue-based Storybook sandbox.
2. Add some custom decorator to a story. E.g.:

```js
export const Primary = {
  args: {
    primary: true,
    label: 'Button',
  },
  decorators: [
    (Story) => ({
      render(h) {
        return h('div', null, [h(Story())])
      }
    })
  ]
};
```

3. In Storybook, navigate to the docs page and expand the code block.

### System

```shell
Environment Info:

  System:
    OS: macOS 13.5
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.15.0 - ~/.asdf/installs/nodejs/18.15.0/bin/node
    Yarn: 3.6.3 - ~/.asdf/shims/yarn
    npm: 9.5.0 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Chrome: 116.0.5845.96
    Safari: 16.6
  npmPackages:
    @storybook/addon-essentials: ^7.4.0-alpha.1 => 7.4.0-alpha.1
    @storybook/addon-interactions: ^7.4.0-alpha.1 => 7.4.0-alpha.1
    @storybook/addon-links: ^7.4.0-alpha.1 => 7.4.0-alpha.1
    @storybook/blocks: ^7.4.0-alpha.1 => 7.4.0-alpha.1
    @storybook/jest: next => 0.2.1-next.0
    @storybook/test-runner: next => 0.13.0-next.2
    @storybook/testing-library: next => 0.2.1-next.0
    @storybook/vue: ^7.4.0-alpha.1 => 7.4.0-alpha.1
    @storybook/vue-vite: ^7.4.0-alpha.1 => 7.4.0-alpha.1
```


### Additional context

_No response_
Repository: PowerToys
Issue: FancyZones Snap Breaks when also Using Keyboard Manager Key Remapping for Windows <-> Alt Key
Labels: Issue-Bug,Product-Keyboard Shortcut Manager,FancyZones-Hotkeys,Product-FancyZones,Needs-Triage,Needs-Team-Response

### Microsoft PowerToys version

0.72.0

### Installation method

PowerToys auto-update

### Running as admin

Yes

### Area(s) with issue?

FancyZones

### Steps to reproduce

Context: I've got a Kinesis Freestyle Mac Keyboard. I've started using it on my Windows Laptop. I remapped the left side of the keyboard's Windows <-> Alt keys, so that the keyboard correctly mirrors a normal Windows keyboard layout.

1. Open Keyboard Manager
2. Open Remap Keys
3. Remap Win (Left) to Alt (Left), and Alt (Left) to Win (Left)
4. Save and close Remap Keys
5. Open Fancy Zones
6. Setup Fancy Zones of your choice (in my case, horizontal and vertical halves)
7. Try to Snap to Fancy Zones with Keyboard (Windows + Left/Right/Up/Down)
For step 7, note that this is the Remapped Alt Key, now a Windows key, that is being used.

### ✔️ Expected Behavior

Snaps Correctly to Fancy Zones.

### ❌ Actual Behavior

Doesn't snap correctly. Not sure if it's using default windows snapping instead, but it's odd.

### Other Software

_No response_
Repository: godot
Issue: Can't set "Local to Scene" in script 
Labels: bug,topic:gdscript,needs testing

### Godot version

4.1.1

### System information

Windows 10

### Issue description

I have created a simple scene that displays text whenever the Player enters an Area3D. This achieved using an Area3D, CollisionShape3D, and a RichTextLabel.  RichTextLabel text is written through the script. 

I was going to use this scene multiple times within my Main Level Scene, but it would appear that whenever I edit one instance of the Area3D's scenes via RichTextLabel, all Area3D scenes and its accompanying text is changed as well. "Local to Scene" does not work and is even switched off whenever I reboot the project. 

Any ideas as to why? 


```gdscript
extends Area3D

var richTextLabel: RichTextLabel

func _ready() -> void:

	
	pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	
	pass

func _on_body_entered(body: Node3D) -> void:
	if body.is_in_group("Player"):
		print("Player entered the special area.")
		$RichTextLabel.bbcode_text = "[center][color=red][font size=32] DOOM"
		
func _on_body_exited(body: Node3D) -> void:
	if body.is_in_group("Player"):
		$RichTextLabel.bbcode_text = " "
		
		
		
	pass 
```
N/A
Repository: pytorch
Issue: FakeMode should not fakify non persistent buffer
Labels: triaged,enhancement,oncall: pt2,module: fakeTensor,module: pt2-dispatcher

I initially came across this information while working with ONNX fake mode export, where the FakeMode fakifies all tensors except for constant tensors.

Referring to https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.register_buffer, non-persistent buffers can not be accessed through state_dict(). This implies that when attempting to open and load the state_dict() of a model in FakeMode, the non-persistent buffers are absent forever. Is there a way to retain non-persistent buffers in FakeMode, similar to how constant tensors are retained?

cc @ezyang @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang @eellison @wconstab @BowenBao
Repository: next.js
Issue: Current "graceful shutdown" behavior is not graceful
Labels: bug,Output (export/standalone)

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
n/a
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

App Router, Standalone mode (output: "standalone")

### Link to the code that reproduces this issue or a replay of the bug

n/a

### To Reproduce

n/a

### Describe the Bug

Both Pages & App Router describe a "manual graceful shutdowns" feature, implying that there is an automatic mode: https://nextjs.org/docs/app/building-your-application/deploying#manual-graceful-shutdowns

The shutdown code for `next` registers a shutdown handler which is not graceful: https://github.com/vercel/next.js/blob/v13.4.20-canary.5/packages/next/src/bin/next.ts#L121-L124

### Expected Behavior

I expect web servers to implement a graceful shutdown and not terminate in-progress connections. This is more evident with long-running streaming responses, such as streaming AI requests or other high latency requests. A client should almost never see a socket closed unceremoniously.

I expect the Next.js server to implement a basic "graceful shutdown" whereby:
* New connections are refused
* Existing sockets are held open until completion

Additionally, for cloud native deployments whereby a route handler is used for liveness and readiness, I would expect the application to be able to detect that a graceful shutdown is in progress:

```
// /app/health/readiness/route.tsx
export async function GET() {
  if (inGracefulShutdown()) {
    return new Response('shutdown', { status: 500 });
  }
}
```

Using a library similar to https://github.com/gajus/http-terminator, for example.

### Which browser are you using? (if relevant)

n/a

### How are you deploying your application? (if relevant)

n/a
Repository: pytorch
Issue: DISABLED test_conv_with_as_strided_cpu (__main__.FreezingCpuTests)
Labels: module: rocm,module: cpu,triaged,skipped

Platforms: rocm

This test was disabled because it is failing on main branch ([recent examples](http://torch-ci.com/failure/inductor%2Ftest_inductor_freezing.py%3A%3AFreezingCpuTests%3A%3Atest_conv_with_as_strided_cpu)).

Skipping for now as this has shown up on a few PRs e.g https://github.com/pytorch/pytorch/pull/107812. Long term I do not think we want these CPU tests running on ROCm either way. Disabling with issue for now and will assess further.

cc: @pragupta @jithunnair-amd 

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @hongxiayang @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10
Repository: flutter
Issue: Incorrect plural string returned when device language is set to Latvian. 
Labels: framework,a: internationalization,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.13,found in release: 3.14

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

https://github.com/ReinisSprogis/flutter-plural-bug

1. Set the device language to Latvian.
2. Tap on Floating action button to increment value. 

### Actual results


When the device language is set to Latvian, the plural strings are not handled correctly. For example, the string for the count "10" should be "10 punkti," but it incorrectly returns "Nav pievienotu punktu."


In English
`"count": "{count, plural, =0{No points added} =1{1 point} other{{count} points}}",`
In Latvian would be
`"count": "{count, plural, =0{Nav pievienotu punktu} =1{1 punkts} other{{count} punkti}}",`


0 returning = Nav pievienotu punktu
1 returning = 1 punkts
2 to 9 returning correct string

However when it hits 10 showing "Nav pievienotu punktu" so all the way up to 20.
21 showing = 1 punkts
22 showing = 22 -29 correct result
30 showing = Nav pievienotu punktu
31 showing = 1 punkts 
33 showing = 33 punkti

And so on. 


### Logs

<details>
<summary>Logs</summary>

```console

No logs

```

</details>


### Flutter Doctor output

<details>
<summary>Doctor output</summary>

```console

[√] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.19045.3324], locale en-GB)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2022 17.5.5)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.81.1)
[√] Connected device (4 available)
[√] Network resources

```

</details>
Repository: pytorch
Issue: [feature request] [ux proposal] Min-max linear normalization to be supported in F.normalize (or in a new function)
Labels: module: nn,triaged,topic: new features

### 🚀 The feature, motivation and pitch

It's useful as one of way of various image / arbitrary normalizations

E.g. supported in OpenCV: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ggad12cefbcb5291cf958a85b4b67b6149fa9f0c1c342a18114d47b516a88e29822e in the cv2.normalize function: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd

Also, related, NumPy supports https://numpy.org/doc/stable/reference/generated/numpy.ptp.html function which computes difference `amax() - amin()`

My impl is simple (althgough it would be best to set by default `eps = torch.finfo(x.dtype).min` to accomodate float16 inputs), but it would be nice to have it supported by core convenience F.normalize function:
```python
def normalize_min_max_(x, dim, eps = 1e-12):
    # workaround for https://github.com/pytorch/pytorch/issues/61582
    amin, amax = x.aminmax(dim = dim, keepdim = True)
    return x.sub_(amin).div_(amax.sub_(amin).add_(eps))
```

### Alternatives

_No response_

### Additional context

_No response_

cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
Repository: flutter
Issue: [Impeller] Determine set of portable GPU counters that can be exposed to DevTools.
Labels: P3,e: impeller,team-engine,triaged-engine

The aim is to expose more information to DevTools for additional profiling tools.
Repository: PowerToys
Issue: [Peek] Show unsupported file preview as overlay for supported types
Labels: Idea-Enhancement,Needs-Triage,Product-Peek

### Description of the new feature / enhancement

We could add an button or other trigger to the title bar that shows an overlay containing the name, path, size, type and icon for all supported file types.

### Scenario when this would be used?

When I want to know the file properties of a file having a supported file type.

### Supporting information

_No response_
Repository: TypeScript
Issue: JS `Object.defineProperty` declaration can't define divergent accessors
Labels: Suggestion,Domain: JavaScript,Experience Enhancement

### 🔎 Search Terms

divergent accessors setter getter expando js jsdoc

### 🕗 Version & Regression Information

- This is the behavior in every version I tried


### ⏯ Playground Link

https://www.typescriptlang.org/play?filetype=js#code/MYewdgzgLgBAHjAvDA3gXwNwCgsHkBGAVgKbBQB0AJsQGYCWYxACgE4gAOxLUAngBRwANDABEUYtBHCUWGDAD0AKkUwAAi2JQAri0ipoLBgHM0MRfNkwjmvgEpUluRu27RI7HLSDLSlavYAhiwBALaoYFoh+FymAWYWchA2Afbo3mi22Fg0WmBkdOAwdBAgADYB4gBibCEAonCBYJQgAIIQEHRGYCHEYFAQAEIMlMZ2DnJw5OLQSDAALABMGAryMFxsLDD4WrAQABYgWqWUW8QwuADSWGhYQA

### 💻 Code

```ts
const x = {};

Object.defineProperty(x, "test", {
  /** @returns {string} */
  get() {
    return "";
  },
  /** @param {number} a */
  set(a) {},
});

function isolateFromExpandoAssignmentsBinding() {
  x.test = 42; // error but should be OK
}
```


### 🙁 Actual behavior

The write type of this expando member is `string`

### 🙂 Expected behavior

The write type of this expando member should be `number` since divergent accessors are allowed nowadays

### Additional information about the issue

_No response_
Repository: flutter
Issue: Warn developers if `main` is running for very long without producing a frame.
Labels: engine,c: proposal,P2,team-engine,triaged-engine

Multiple application teams have been observed to do a pattern like the following:

```dart
void main() async {
  final foo = await _setupFoo();
  PlatformDispatcher.instance.onError = mySpecialErrorHandler;
  doBar(await _someFutureValue());
  await _theNextThing(foo);
  await _anotherThingThatWeAddedLater();
  // Many more such awaits

  runApp(MaterialApp(home: MyRootWidget(specialThing: await makeSpecialThing()));
}
```

As this kind of code grows and more `await`s are added, it gets harder and harder to disentangle. But the time the product is getting ready to ship, the application is spending some significant amount of time in `main` before ever trying to render a frame.

We should print a warning about this. The only time this would be desirable is in the case where a developer is pre-warming the engine while showing non-Flutter UI, in which case they could ignore the warning.

This would be similar to the way that Android warns you if the choreographer gets delayed by too long and tells you that you "may be doing too much work on the main thread." The goal would be to have an earlier signal to the application development team to start cleaning this up before it becomes even more entangled.

@jiahaog WDYT?
Repository: flutter
Issue: DisplayList construction should track multiple sources of NOP state independently
Labels: engine,c: proposal,P3,team-engine,triaged-engine

Currently we have a single variable in the DisplayList recording code to note when the rendering state becomes a NOP, but there are 3(+) conditions which could affect this state:

1. `SaveLayer` can save with a `DlPaint` object that won't render. This condition is reversed during a `Restore` call.
    - (A single rendering op can also be a NOP due to its own paint, but that condition is handled locally to that rendering call and not recorded as it just affects the one call.)
2. A `ClipRect`, `ClipRRect`, or `ClipPath` call can cause the clip to become empty. This condition is reversed during the next `Restore` call.
3. Many of the transform calls can cause the current transform matrix to become non-invertible (which maps all pixels to an infinitely thin line or point which is effectively a NOP state). This condition can be reversed in 1 of 2 ways:
    - The next `Restore` call will reset the transform
    - If the caller calls `TransformReset` or `SetTransform`

The first 2 cases have the same termination action - calling the `Restore` method. But the 3rd case has 2 ways in which it could be reversed.

Currently we only track the first 2 cases anyway (save layer paint and clips which have the same termination condition), but if we ever start detecting NOP situations based on the 3rd (transforms) then we will want to track the type of NOP condition in multiple state variables or this tracking deficiency could cause bugs to occur. We should fix the code to be more explicit anyway before `dl_op_recorder.cc` (or the legacy `dl_builder.cc` code is modified to track the transform "NOP" state.
Repository: flutter
Issue: Widget tester key press simulation should make it easier to discover platform options and implications.
Labels: a: tests,framework,d: api docs,P2,team-framework,triaged-framework

Widget tester key press simulation should make it easier to discover platform options and implications.

There are at least two poorly documented details related to key simulation, e.g., when calling `await tester.sendKeyEvent()`.

There are certain keys that aren't supported on certain platforms. For example, logical key `f14` is supported on desktop, but throws an exception when you try to simulate that against `android`.

The user can specify the platform to simulate using the `platform` named property in `sendKeyEvent()`. However, it's difficult to figure out which values are permitted for `platform`. For example, I wanted to specify Mac, so I tried "mac" but that wasn't recognized. Then I tried "macOS", but that wasn't recognized either. Eventually I found the following source code in Flutter:

```dart
static bool _osIsSupported(String platform) {
    switch (platform) {
      case 'android':
      case 'fuchsia':
      case 'macos':
      case 'linux':
      case 'web':
      case 'ios':
      case 'windows':
        return true;
    }
    return false;
  }
```

As a Flutter user, I don't want to have to jump through 5 Flutter source code references to find the allowable raw `String` values. This is an unnecessary friction.

The documentation for `sendKeyEvent()` only says the following, which misses 5 of the available platforms:

```dart
/// Specify `platform` as one of the platforms allowed in
  /// [platform.Platform.operatingSystem] to make the event appear to be from
  /// that type of system. Defaults to "web" on web, and "android" everywhere
  /// else. Must not be null.
```

Moreover, this documentation makes no mention of limitations towards logical key IDs, i.e., the documentation doesn't give any indication that an existing key constant, such as `f14`, might throw an exception.

To solve the platform name issue, you could update the documentation for all key simulation methods to include the names of every platform. Or, you could place those raw strings into named static properties in a class, and then reference that from the key simulation docs, e.g., `PlatformName.mac`, etc.

For the key code exception issue, all key simulation methods should be updated with appropriate disclaimers and breadcrumbs to determine which keys are supported for a given platform.
Repository: pytorch
Issue: Provide a `reset_parameters()` method for MultiheadAttention to support FSDP meta device initializtion
Labels: module: nn,triaged,module: fsdp

### 🚀 The feature, motivation and pitch

The [MultiheadAttention](https://github.com/pytorch/pytorch/blob/2fbe6ef2f866fe6ce42a950f2053f2f6b4bdab90/torch/nn/modules/activation.py) layer has a protected [`_reset_parameters()`](https://github.com/pytorch/pytorch/blob/2fbe6ef2f866fe6ce42a950f2053f2f6b4bdab90/torch/nn/modules/activation.py#L1020) method that is responsible for initializing the params. In light of the newly introduced approach to init modules on the meta device and materializing them with FSDP (https://github.com/pytorch/pytorch/issues/104187), it would be great if the `MultiheadAttention` module could expose the `_reset_parameters` as public so FSDP can call it internally. 


### Alternatives

Currently, the user has to modify the source code or patch it like so:
```py
MultiheadAttention.reset_parameters = MultiheadAttention._reset_parameters
```

### Additional context

cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki @zhaojuanmao @mrshenli @rohan-varma @awgu @fegin @penguinwu

I'd be happy to send a PR if there are no objections.
Repository: flutter
Issue: [Impeller] Support correctly mask blurring against any color source when drawing Text.
Labels: engine,P3,e: impeller,team-engine,triaged-engine

When drawing a text frame with a mask blur, we currently just apply a gaussian blur to the rendered text. This renders the correct result when the color source is a solid color (for example, while drawing shadows), but if the color source is something else, we'll end up erroneously blurring the color source and not just the mask.

When addressing this, we need to be careful about how mask blurs interact with color filters, lest we wind up color filtering content unmodulated by the geometry mask of the text.
Repository: godot
Issue: move_and_slide() sometimes reports slide collisions with normals opposite to the direction of motion
Labels: bug,topic:physics

### Godot version

v4.1.1.stable.official [bd6af8e0e]

### System information

Godot v4.1.1.stable - Windows 10.0.22621 - Vulkan (Compatibility) - NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.3667) - 11th Gen Intel(R) Core(TM) i5-11300H @ 3.10GHz (8 Threads)

### Issue description

When moving past a ledge in an up-right/up-left direction, move_and_slide() will sometimes report a collision with the normal (0, -1).

This causes is_on_floor() to return true for one frame, even though the body is moving upwards.

### Steps to reproduce

Push into a wall and jump against a ledge.

In some cases, generally dependent on height, this issue will occur.

(Inconsistent, might take multiple tries to reproduce)

After the issue occurs, an assert statement will trigger.

### Minimal reproduction project

[MinimalReproductionProject.zip](https://github.com/godotengine/godot/files/12434249/MinimalReproductionProject.zip)