sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Mode to warm up PT2 with a regular eager mode execution
Labels: feature,triaged,oncall: pt2

### 🐛 Describe the bug

When we originally were designing the warmup policy of PT2, we had a lot of discussion about whether or not we should do background compilation vs wait for compilation on the very first round. We never ended up doing background compilation because it is a bit of work for a Python compilation stack (GIL contention means that you'd have to do it out of process... out of process is complicated...) Another problem was that PT2 could potentially apply memory saving optimizations, that might end up being mandatory: your model would OOM if not run under PT2. (In practice, this is rarely the case today, and even when it is true people have a preference for keeping their eager mode runnable.)

I think a more limited form of warmup would be useful for PT2, and possibly even should be the default setting. Instead of immediately attempting to compile, we instead only do a Dynamo level analysis and then bail to the regular CPython interpreter. Only when the frame is deemed sufficiently hot do we actually perform compilation.

This "wait and see" strategy has several benefits:

1. We can record how long a frame takes in eager mode. If the walltime of the frame is very low, there is not much benefit to compiling it, and we can choose to skip it (even if, in principle, we could compile it.) If we do end up compiling it, we can compare how long eager took with compile without user intervention, and automatically report how much speed up PT2 gave. This is a great benefit in a production setting, since we can monitor the benefit of PT2 and observe the effect of optimizations in aggregate.
2. If a frame is dynamic (sizes/ints vary from run to run), we can avoid compiling an overly specialized frame; by waiting, we are more likely to predict which sizes truly are dynamic and properly compile them. We can also partially solve the problem described in https://github.com/pytorch/pytorch/issues/105634#issuecomment-1645624378 by using the *largest* observed size for tuning (in this case, the user may need to assist in saying when warmup should end.)
3. If a frame will eventually be skipped, we can detect if this would happen, by generating "ghost" guards which we check if they match. If we see that we never manage a cache hit, we can give up before we've actually spent time doing expensive inductor lowering compilation. (This is also incomplete, as we won't generate guards from AOTAutograd/Inductor, but my guess is these are not the bulk of the recompilation reasons.)

(1) by itself is compelling enough that I would add this as an option. But I am really tantalized by the prospect of automatic telemetry about how much speedup PT2 is giving.

cc @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang @wconstab @kumpera whose questions inspired me to think more carefully about this

### Versions

main
Repository: go
Issue: image/gif: image bounds obtained by image.Decode and gif.Decode are different
Labels: ExpertNeeded,NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
-->

### What version of Go are you using (`go version`)?

<pre>
❯ go version
go version go1.20.4 darwin/arm64
</pre>

### Does this issue reproduce with the latest release?

yes

### What operating system and processor architecture are you using (`go env`)?

macOS arm64

should have no effect

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on go.dev/play is best.
-->

https://go.dev/play/p/f0RmDYbQALy

### What did you expect to see?

outputs nothing because I want `got` and `want` to be the same

### What did you see instead?

```
❯ go run main.go
(0,0)-(10,10) (48,0)-(58,10)
```
Repository: next.js
Issue: `cache` Function Fails to Cache API Responses, While `fetch` Function Caches Successfully
Labels: bug,Pages Router

### Verify canary release

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

### Provide environment information

```bash
Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.12.1
      npm: 8.19.2
      Yarn: 1.22.19
      pnpm: N/A
    Relevant Packages:
      next: 13.4.11
      eslint-config-next: 13.4.11
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A
```


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

App Router, Data fetching (gS(S)P, getInitialProps)

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

https://github.com/Rishab1207/nextjs-sandbox

### To Reproduce

1. Clone the repo: https://github.com/Rishab1207/nextjs-sandbox
2. Install all the packages using `npm i` or `yarn`
3. Clone https://mockapi.io/clone/64baaf385e0670a501d68880
4. In the path `utils/getUser.ts` replace `URL` to your `mockapi` URL
5. Run the dev server 
6. Change the user count from mock api

### Describe the Bug

When utilizing the Next.js cache function, it appears that the API responses are not being cached as expected. However, we've observed that the fetch function, on the other hand, successfully caches the responses. 

### Expected Behavior

cache` function should cache the responses successfully

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

Version 114.0.5735.198 (Official Build) (arm64)

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

_No response_
Repository: terminal
Issue: Position the experimental, optional right-click context menu so a left click will paste
Labels: Help Wanted,Area-TerminalControl,Product-Terminal,Issue-Task

# Description of the new feature/enhancement

As a terminal user
When I right-click and get a menu
I want "Paste" to be the default option that appears directly where my mouse is

# Proposed technical implementation details (optional)

The menu should always open such that the paste icon is directly below the cursor, instead of sometimes slightly above and to the right, and sometimes slightty above and to the left.

## Do you realize the behavior is inconsistent?

- The first time I right click, it opens with the cursor just to the _left_ of the the line between the buttons and the text menu items.
- If you right-click **elsewhere** _while the menu is open_, it moves to be horizontally centered on the mouse
- If you right-click **on** the menu (and then move your mouse off the menu), you get the window's title-bar context menu
Repository: TypeScript
Issue: useUnknownForAnyReturn and useUnknownForAnyParam
Labels: Suggestion,Awaiting More Feedback

# ⭐ Suggestion

Currently there's `useUnknownInCatchVariables` which allows changing the error type in catch to unknown (from any) by default.
Using the same reasoning why that option was introduced, I think it would make sense for 1 or 2 more options in a similar vein:

- useUnknownForAnyReturn: if a function returns "any", treat it as if it were "unknown" when the function is called. This is useful especially with 3rd party libs, but also in general, since "unknown" is much stricter than "any" (which is one of the reasons e.g. @typescript-eslint has a "no-unsafe-assignment" rule - which often cannot be fixed, since the "any" comes from a third party package)

- useUnknownForAnyParamCallback: if a function/callback does not have any types specified, the default is any. It would make checking better if it would be treated as "unknown" instead of "any", when this flag is set.

## 🔍 Search Terms

All mentioned in the suggestion above

## ✅ Viability Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).

## 📃 Motivating Example

```
import foo from 'foo';

const bar = foo(); // foo returns any

acceptsStringOnly( arg ); // no error reported, since "any" is allowed for string, but when running the code in browser, this will give an error, that tsc could easily catch, if it were "unknown" instead of "any" 

if ( arg === false ) {
    // arg is still type "any", because type guard doesn't work on "any"
}
```

## 💻 Use Cases

Stricter type checking to avoid bugs popping up when using 3rd party code/any return, where that value is used in functions that have stricter requirements.
If you look at error data (e.g. sentry) you will see that this is actually the most common error reported from users browsers, as the "any" is an escape hatch from the type system, making type validation in typescript useless in some cases - which is the reason why the  `useUnknownInCatchVariables` was implemented already.
Repository: create-react-app
Issue: Typescript Custom Declaration Files Not Resolving
Labels: needs triage,issue: bug report

### Describe the bug

I'm not able to resolve custom typescript declaration files when running the project. The project compiles with ```tsc``` fine, but ```react-scripts``` reports:

```
Module not found: Error: Can't resolve 'MyLibrary' in 'C:\dev\github\custom-types\src'
```

### Did you try recovering your dependencies?

Repros on latest build.

### Which terms did you search for in User Guide?

### Environment

```
Environment Info:

  current version of create-react-app: 5.0.1
  running from C:\Users\adstep\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.25393
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  Binaries:
    Node: 19.2.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 115.0.5790.102
    Edge: Spartan (44.25393.1.0), Chromium (115.0.1901.183)
    Internet Explorer: 11.0.25393.1
  npmPackages:
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    react-scripts: 5.0.1 => 5.0.1
  npmGlobalPackages:
    create-react-app: Not Found
```

### Steps to reproduce

Starting from a newly minted app using the typescript template I....

1. Added a custom definition file under ```src/types/MyLibrary/index.d.ts```:  

```
declare module 'MyLibrary' {
    export function Sum(a: number, b: number);
}
```

2. Updated ```tsconfig.json``` to define typeRoots:
```
"typeRoots": [
      "node_modules/@types", 
      "src/types"
    ],
```

3. Added a reference to the custom definition in ```src\App.ts```.

### Expected behavior

App compiles without any errors.

### Actual behavior

Error logs:

```
src\App.tsx
  Line 7:12:  'DoSomething' is defined but never used  @typescript-eslint/no-unused-vars

ERROR in ./src/App.tsx 7:0-32
Module not found: Error: Can't resolve 'MyLibrary' in 'C:\dev\github\custom-types\src'

webpack compiled with 1 error and 1 warning
Files successfully emitted, waiting for typecheck results...
Issues checking in progress...
No issues found.
```

### Reproducible demo

I have created a repo that demonstrates the issue see [custom-types](https://github.com/adstep/custom-types).
Repository: godot
Issue: Window placement on multi monitor with Example `Main Menu` not working under linux
Labels: bug,platform:linuxbsd,needs testing,topic:gui

### Godot version

4.1.1.stable

### System information

Linux Mint 21.2

### Issue description

Example `Godot 4.0 Main Menu` not run, when you change Window Placement to another screen.


### Steps to reproduce

Fresh new installation with Godot 4.1.1 and i add `Godot 4.0 Main Menu` example project.
Run it with F5 works.

Change Editor > Editor Settings > Window Placement > Screen to an antoher screen

Run with F5 opens the window, but it is empty.
Stack Trace Error "Invalid type in function 'select' in base 'OptionButton'. Cannot convert argument 1 from Nil to int.
Stack Frames
0 - res://src/menu_controller.gd:74 - at function: _ready
Line 74 `Resolution_ob.select(_check_resolution(DisplayServer.screen_get_size()))`

Is my first try with Godot, and iam not sure if this is an example problem or Godot.

### Minimal reproduction project

View Example.
Repository: electron
Issue: [Feature Request]: Creating snapshot with native modules using mksnapshot
Labels: enhancement :sparkles:

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

I'm trying to put the main process code in a snapshot using `mksnapshot`. I can get everything other than native modules to work. Since we can't use `require` or `process.dlopen` with `mksnapshot`, how to load native modules?

For example, if we can get something like this to work
```js
var print = load('./node_modules/a-native-example/build/Release/a_native_example.node')
```

It would be simple to figure out the rest (bundling or preparing the script)

### Proposed Solution

I'm not sure how to solve this, but this [comment](https://github.com/atom/electron-link/issues/1#issue-222957513) by @hashseed might be of some help.

I guess it needs some custom C++ code to enable loading the native modules. Or modifying mksnapshot to expose something similar to dlopen to the script?

Or if native modules can be loaded with some internal V8 method then we might be able to use that with `--allow-natives-syntax` (not sure if mksnapshot supports it)

### Alternatives Considered

No ideas at the moment

### Additional Information

I'm using Electron v22 on macOS ventura.
`dlopen` calls add atleast 1.5 sec to startup for me, so it'd help a lot if this can be reduced.

Thanks.
Repository: godot
Issue: Reimporting saved-to-file meshes removes materials
Labels: bug,topic:editor,confirmed,topic:import,topic:3d

### Godot version

v4.2.dev1.official [0c2144da9]

### System information

Arch Linux

### Issue description

If you extract as Resources (save to file) the meshes from a glTF file, and use those meshes in MeshInstance3D nodes, when you reimport the glTF file all assigned Materials will be removed from your MeshInstance3D nodes.

### Steps to reproduce

Steps to reproduce the issue in the Minimal reproduction project:

1. Open the **mesh_instance_3d.tscn** Scene. The MeshInstance3D node is using the **cube_mesh.res** Resource extracted from the **cube.glb** glTF file. There is a Material assigned to the _surface_material_override_ (surface 0) property.
2. Open the **cube.glb** file and click Reimport.
3. The assigned material in _surface_material_override_ is now gone.

**NOTES**: If you close the project and reopen it, the Material will be back. If you save the project (even if there is no * indicating a modification), the Material is gone for good.

### Minimal reproduction project

[import_bug.zip](https://github.com/godotengine/godot/files/12136069/import_bug.zip)
Repository: pytorch
Issue: torch.sparse.mm() with reduce operator for GPU support and COO matrices
Labels: module: sparse,feature,triaged,module: reductions

### 🚀 The feature, motivation and pitch

I am working on a ML program and need to use sparse matrix multiplication with "reduce" operator. 

Here is an example:
```
a = torch.sparse_coo_tensor(torch.tensor([[0, 0, 1, 1, 2, 2], [0, 1, 0, 1, 0, 1]]), [1., 2., 3., 4., 5., 6.], size=[3, 2])
b = torch.tensor([[7, 9], [8, 10]], dtype=torch.float, requires_grad=True)
# a and b are the input. a is a sparse-COO matrix, and b is a typical dense matrix with grad
a_csr = a.to_sparse_csr()
c = torch.sparse.mm(a_csr, b, "max")
print(c) # c is what I want
```
Currently the above codes is the only way for my work, but it runs quite slow for not supporting GPU, and is redundant for converting COO to CSR.

What I hope to be possible: 
1. enable GPU support to the reduce operator, and
2. enable COO matrix with the reduce operator.

Thanks a lot for your help!


### Alternatives

_No response_

### Additional context

According to the docs [here](https://pytorch.org/docs/stable/generated/torch.sparse.mm.html#torch.sparse.mm), currently `reduce` is implemented only for CSR storage format on CPU device.

cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer
Repository: godot
Issue: 2D Light Occlusion appears broken in 3.5.2 and also 4.1
Labels: bug,discussion,topic:rendering,topic:2d

### Godot version

3.5.2 and also 4.1

### System information

Windows 11, GLES3 (3.5.2) & Mobile (4.1)

### Issue description

2D Light Occlusion doesn't work as intended in both 3.5.2 and also 4.1.

Creating a simple scene with a tilemap, tiles set to occlude 
(This also happens when using a Light Occluder2D on sprites)
Adding a PointLight2D with texture and shadows enabled.

In Godot 3.5.2 when you enable Shadow the texture turns to a block:
![Screenshot 2023-07-21 175252](https://github.com/godotengine/godot/assets/40317509/97251329-8cf7-40d0-a6e6-4adde7756976)
![Screenshot 2023-07-21 175322](https://github.com/godotengine/godot/assets/40317509/6b9402a5-2d72-4eb1-8eca-143b138b0fc4)


In Godot 4.1 shadows work until the Light2D moves over the occluded tile or sprite, then the object becomes lit, when it should stay dark.
![Screenshot 2023-07-21 174006](https://github.com/godotengine/godot/assets/40317509/e6a70d3c-8580-4902-88e9-b0b9e79982f4)
![Screenshot 2023-07-21 174051](https://github.com/godotengine/godot/assets/40317509/1f7be412-2729-480e-9776-aa7048e0c96f)
![Screenshot 2023-07-21 174124](https://github.com/godotengine/godot/assets/40317509/3001783e-33e5-4433-8ff3-0d4f654c5ca0)


### Steps to reproduce

Creating a simple scene with a tilemap, tiles set to occlude 
(This also happens when using a Light Occluder2D on sprites)
Adding a PointLight2D with texture and shadows enabled.

In 3.5.2 move enable shadow, the texture turns into a block.
In 4.1 shadows work until you move the 2D light over the sprite/tile, then it becomes illuminated when it should stay dark.

### Minimal reproduction project

[Test Occlusion Tilemap Shadow 3.5.2.zip](https://github.com/godotengine/godot/files/12136240/Test.Occlusion.Tilemap.Shadow.3.5.2.zip)
[Test Occlusion Tilemap Shadow 4.1.zip](https://github.com/godotengine/godot/files/12136241/Test.Occlusion.Tilemap.Shadow.4.1.zip)
Repository: godot
Issue: Editor crashes when renaming a scene's folder that was instantiated to a scene and not saved
Labels: bug,topic:editor,crash

### Godot version

4.1.1.stable.official

### System information

Windows 10

### Issue description

Editor crashes when I try to rename a folder that has a scene, that was instantiated in another scene and that scene wasn't saved.

Seems similar to https://github.com/godotengine/godot/issues/66556 but their problem doesn't crash it anymore

### Steps to reproduce

1. Open the player scene and instantiate the Hitbox scene "res://CollisionBoxes/hitbox.tscn" to the root node
2. Don't save the scene
3. Try to rename the folder that has the hitbox scene "res://CollisionBoxes/"
4. Editor crashed with blank error message. Unsaved progress is lost. Instead it should prevent you from changing the folder name or do something else

### Minimal reproduction project

[game - Copy.zip](https://github.com/godotengine/godot/files/12136242/game.-.Copy.zip)
Repository: flutter
Issue: [quick_actions] Navigator opens the page twice through shortcuts if app is not running
Labels: platform-android,p: quick_actions,package,has reproducible steps,P2,found in release: 3.10,team-android,triaged-android,found in release: 3.13

### 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

tested only on the Android environment

1. Create a fresh flutter project for android
2. Add quick_actions and create a sample shortcut
3. Run the app and close the app temporarily using back button
4. Run the shortcut
5. The page opens twice

If the app is already in the background, it opens only once as it should.

### Expected results

The page navigated to using app shortcuts opens only once

### Actual results

The page navigated to using app shortcuts opens twice

### Code sample

<details><summary>Code sample</summary>

https://github.com/milindgoel15/shotcuts

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

https://imgur.com/D5VnkY1
</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.22621.1992], locale en-IN)
    • Flutter version 3.10.6 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (10 days ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\Lenovo\AppData\Local\Android\Sdk
    • Platform android-33-ext4, build-tools 33.0.1
    • ANDROID_SDK_ROOT = C:\Users\Lenovo\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[✓] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[✓] VS Code, 64-bit edition (version 1.80.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.66.0

[✓] Connected device (1 available)
    • 2109119DI (mobile) • 417812e0 • android-arm64 • Android 13 (API 33)

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>