sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: node
Issue: HttpOutgoingMessage.writable is always true
Labels: http,stream

### Version

v14.19.1 / v16.14.2

### Platform

Linux ROGLaptop 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

### Subsystem

http

### What steps will reproduce the bug?

```js
const { ServerResponse } = require('http');

const res = new ServerResponse({});

console.log(res.writable); // true

res.destroy(); 

console.log(res.writable); // true
```

### How often does it reproduce? Is there a required condition?

Always

### What is the expected behavior?

`.writable` should be `false` on destroy

### What do you see instead?

`.writable` is always `true`

### Additional information

Since with v14+, streams no longer output errors when destroyed/ended, you need to check before piping to them. On any other stream (eg: Http2, Transform, Passthrough, Writable), you can check with `.writable`. This doesn't work on Http1 `ServerResponse` objects.

Normally, this code point is used to check if writable:

https://github.com/nodejs/node/blob/d58f4081b534ff6cb017c5d8e9c1bffc8308d2b5/lib/internal/streams/writable.js#L808-L809

Instead, it's always true:

https://github.com/nodejs/node/blob/d58f4081b534ff6cb017c5d8e9c1bffc8308d2b5/lib/_http_outgoing.js#L110

It would require special steps to see if we are piping / writing to an Http1 `ServerResponse` and then handle differently, or just abandoning `.writable` eg:

````js
return (stream instanceof ServerResponse ? (!stream.destroyed && !stream.writableEnded) : stream.writable)
````

I'm not sure how to safely check again `errored`, but I'd assume it would always signal destroyed.
Repository: pytorch
Issue: large model, low memory: need `torch.load` that loads one submodule at a time
Labels: module: serialization,triaged

### 🚀 The feature, motivation and pitch

Here is a puzzle for you:

Say, you have 24GB of GPU RAM and 32GB of CPU RAM and a pretrained fp32 pytorch model checkpoint that is 40GB big.

Say, you want to inference or finetune in fp16 or bf16 and you have enough CPU and GPU memory to handle a 20GB model.

It should be possible, but you can't load the model in half precision because `torch.load` is inflexible and requires that all 40GB be loaded first.

The main issue here is that the user has enough memory to start training in half-precision, but once they saved the checkpoint, they can't resume since they won't have enough memory to allocate the model and load the checkpoint.

Are there any plans to make `torch.load` more flexible and not load the whole thing at once but do it one sub-module (or even param) at a time and bonus for converting to the target `torch.dtype` on the fly.

In other words the hardware requirements should be close to the final model size and not 2x or 3x. Currently it's 3x when the original is in the higher dtype. Here is the breakdown:

```
1x allocate the model in fp16
2x load the fp32 model
-------------------------------
3x Total peak memory
```

With flexible `torch.load`:

```
1x allocate the model in fp16
0.05x allocate the largest layer in fp32
-------------------------------
1.05x Total peak memory
```
(for demonstration 0.01 is an example of a model with 20 equal layers)

At HF Transformers we already use [the hack](https://github.com/huggingface/transformers/blob/104c065277562ba276c46c329144e10c44dce286/src/transformers/modeling_utils.py#L2107-L2122) of allocating the model on the meta device and then materializing the model from the `state_dict`, but this is still not enough as the full fp32 model model has to be loaded first. 

Thank you!


cc @mruberry
Repository: opencv
Issue: Add tutorial for using OpenCV in Swift
Labels: feature,category: documentation,platform: ios/osx,category: swift/objc bindings

##### System information (version)

- OpenCV => :grey_question: >= 4.2
- Operating System / Platform => :grey_question: iOS
- Compiler => :grey_question: XCode 12.4

##### Detailed description

The [original tutorial for using OpenCV in XCode](https://docs.opencv.org/4.x/d7/d88/tutorial_hello.html) has been out of date. There is no tutorial to use OpenCV in XCode for Swift language with Swift UI.
Repository: storybook
Issue: Storybook Interactions File upload causes dialog to open
Labels: bug,help wanted,addon: interactions,sev:S3

**Describe the bug**
When using storybook and @storybook/addon-interactions, a `userEvent.upload(<element>, file)` causes the file upload dialog to appear even though the file was already uploaded by the interaction.

**To Reproduce**
Reproduction repository: https://github.com/ice1080/storybook-upload-issue-repro
(see note below for why I was unable to publish the repo)

**System**
```
$ npx sb@next info

Environment Info:

  System:
    OS: Linux 5.16 Pop!_OS 21.10
    CPU: (20) x64 Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz
  Binaries:
    Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 8.5.1 - ~/.nvm/versions/node/v12.18.2/bin/npm
  Browsers:
    Chrome: 99.0.4844.84
    Firefox: 98.0.2
  npmPackages:
    @storybook/addon-actions: ^6.4.9 => 6.4.9 
    @storybook/addon-essentials: ^6.4.9 => 6.4.9 
    @storybook/addon-interactions: ^6.4.19 => 6.4.19 
    @storybook/addon-links: ^6.4.9 => 6.4.9 
    @storybook/builder-webpack5: ^6.4.9 => 6.4.9 
    @storybook/manager-webpack5: ^6.4.9 => 6.4.9 
    @storybook/react: ^6.4.9 => 6.4.9 
    @storybook/testing-library: ^0.0.9 => 0.0.9 
```

**Additional context**
Steps to see this issue:
Run storybook in the repro repo above.
Click on the "Test Input" story, wait two seconds, the open file dialog is opened, even though the file in the story was uploaded to the input successfully. This causes the rest of the interactions in the story to be hidden.
Note that this only happens when the user manually clicks on the story from a different story. If the component or story is changed and storybook refreshes that story, this behavior does not occur.

Assumed expected behavior:
File upload successfully sets the file on the input without opening the manual select dialog. 

Side note:
I tried to publish the repo using the steps described in the how-to-reproduce, following it exactly, and ran into this error when running the npx chromatic command:
```
sh: 1: chroma: not found
```
and the apt version of chroma is a game that is unrelated to the command trying to be run.
Repository: godot
Issue: Gizmo is visible during GridMap editing
Labels: bug,topic:editor,topic:3d

### Godot version

4.0 dev (340ad7d74869e71d88f6ce7dcb1cf20e924faed2)

### System information

MacOS, Macbook Air M1

### Issue description

Current tool gizmo is visible when editing a GridMap, you can't use it but it steals input events and is visually in the way.

![image](https://user-images.githubusercontent.com/102470155/161686436-15fb08d3-d46c-49b5-9f9b-fd0811ae03e0.png)


### Steps to reproduce

N/A

### Minimal reproduction project

_No response_
Repository: godot
Issue: ViewportTextures that are created programmatically don't work.
Labels: bug,topic:rendering

### Godot version

3.4.2-stable

### System information

Windows 10

### Issue description

I've found that that new viewport textures created with `ViewportTexture.new()` simply don't connect to the viewports that are defined in its `viewport_path` parameter. The texture is shown to be black as if no viewport is attached.

### Steps to reproduce

here is a code sample containing what I've tried:

```gdscript
onready var viewport = get_node("Viewport")


#using the existing material from "Test Mesh Instance" 
onready var viewport_mat = get_node("Test Mesh Instance").get("material/0")

func _ready():
	
	var x = viewport_mat.albedo_texture.viewport_path
	print(x)
	
	#set to false if testing the current existing scene setup
	var SETUP_PROGRAMMATICALLY = true
	
	
	#basically setting up the  material>viewport_texture (that already exists in the scene) programatically
	#this doesn't work and shows the textures as being completely black despite the viewport being entirely red
	if SETUP_PROGRAMMATICALLY:
		
		#create new viewport texture
		var vp_texture = ViewportTexture.new()
		vp_texture.resource_local_to_scene = true
		
		
		#direct viewport texture to viewport in this scene (THIS DOES NOT WORK)
		#(i'm using the value that it is in the scene so this should work)
		vp_texture.viewport_path = x
		#other versions of the line above that do not work:
			#vp_texture.viewport_path = NodePath("Viewport")
			#vp_texture.viewport_path = viewport.get_path()
			#vp_texture.viewport_path = NodePath("root/Spatial/Viewport")
			#vp_texture.set_viewport_path_in_scene(...)
		print(vp_texture.viewport_path)
		
		viewport_mat.albedo_texture = vp_texture


```



### Minimal reproduction project

[Mesh Bug.zip](https://github.com/godotengine/godot/files/8415534/Mesh.Bug.zip)
Repository: vscode
Issue: Make test message be able to toggle between 'verbose' and 'simple' mode.
Labels: feature-request,testing

In Java, we use the test message peek view to display the stacktrace of the failed cases.

sometimes the stacktrace could be very long that contains tens of lines. It would be very helpful if the peek view can accept two set of messages, one is 'verbose' and another is 'simple'. Users can switch between them.

#### Some examples of this UX in other IDES:

##### IntelliJ
![intellij](https://user-images.githubusercontent.com/6193897/161699365-0a7feace-0bf0-4795-b465-a34149d25319.gif)


##### Eclipse
![eclipse](https://user-images.githubusercontent.com/6193897/161699399-ba16de3a-a575-46aa-8f83-986c59038c26.gif)
Repository: material-ui
Issue: [FormControl] Flash of unselected styling on Form Label in a radio group
Labels: bug 🐛,component: FormControl

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Current behavior 😯

This affects the examples given in the documentation. 

When using a FormLabel, RadioGroup and FormControlLabels, as per the documentation example: 

``` 
<FormControl>
      <FormLabel id="demo-radio-buttons-group-label">Gender</FormLabel>
      <RadioGroup
        aria-labelledby="demo-radio-buttons-group-label"
        defaultValue="female"
        name="radio-buttons-group"
      >
        <FormControlLabel value="female" control={<Radio />} label="Female" />
        <FormControlLabel value="male" control={<Radio />} label="Male" />
        <FormControlLabel value="other" control={<Radio />} label="Other" />
      </RadioGroup>
    </FormControl>
```
Clicking the _labels_ of the radio buttons will cause the FormLabel to briefly show the 'unselected' style. 

Clicking the radio buttons themselves will not cause this issue. 

![Screen-Recording-2022-04-05-at-5 27 46-pm](https://user-images.githubusercontent.com/2467377/161702021-38c38a67-dfff-4ccc-b88b-beb8d0f6cbaf.gif)



### Expected behavior 🤔

The flash should not occur. 

### Steps to reproduce 🕹

Steps:

1. Visit: https://codesandbox.io/s/k1xmsu?file=/demo.js
2. Click the radio button _labels_
3. Note that the form label briefly turns grey. 



### Context 🔦

Jarring experience for forms. 

### Your environment 🌎

See sandbox.
Repository: puppeteer
Issue: [Bug]: Screenshot Websites with navigation always on top
Labels: bug,screenshot,confirmed,P3

### Bug description

Some websites have the function with navigation always on top, if the user scrolls, the header or menu, goes along with the page. When trying to take a screenshot of those website, The screenshot taken appears with the top header in the wrong place, is there a way to get around this ?

Example : 
![image](https://user-images.githubusercontent.com/33966960/161719265-e5c73d32-3f0e-4d3a-8bbe-93c8aefbeb6d.png)


Code:


```
const puppeteer = require('puppeteer');


async function autoScroll(page){
    await page.evaluate(async () => {
        await new Promise((resolve, reject) => {
            var totalHeight = 0;
            var distance = 100;
            var timer = setInterval(() => {
                var scrollHeight = document.body.scrollHeight;
                window.scrollBy(0, distance);
                totalHeight += distance;

                if(totalHeight >= scrollHeight){
                    clearInterval(timer);
                    resolve();
                }
            }, 100);
        });
    });
}

(async () => {
    var path = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
    //const browser = await puppeteer.launch();
    const browser = await puppeteer.launch({ 
        executablePath: path,
        headless: true,
        args: [`--window-size=1920,1080`],
        defaultViewport: {
            width:1920,
            height:1080
        }
    });
    const page = await browser.newPage();
    await page.goto('https://www.atlassian.com/software/statuspage');
    await autoScroll(page);
    await page.waitForTimeout(500);
    await page.screenshot({ 
        path: 'example.png',
        fullPage: true
    });

    await browser.close();
})();
```

### Puppeteer version

13.5.2

### Node.js version

16.13.0

### npm version

8.1.0'

### What operating system are you seeing the problem on?

Linux, macOS, Windows

### Relevant log output

_No response_
Repository: godot
Issue: Particles with high velocity / speed scale do not get unique random values
Labels: bug,topic:3d,topic:particles

### Godot version

3.4.4.stable

### System information

Windows 10, Core i7 5820k, GeForce 980TI

### Issue description

If you set up a particle system with really fast moving particles, the particles don't appear to get unique random values. Several particles spawned closed to eachother appear to get the same random direction and scale for example.

This is a real issue for fast moving effects such as sparks.

https://user-images.githubusercontent.com/4955051/161719224-e9c82162-45a8-4729-8bdd-d49f3c0bab90.mp4




### Steps to reproduce

Create a Particle system and set it to high velocity or high speedscale and set random initial velocity and scale.

OR

Open the attached project.

### Minimal reproduction project

[ParticleRandomIssue.zip](https://github.com/godotengine/godot/files/8416601/ParticleRandomIssue.zip)
Repository: flutter
Issue: Provide a way to offset BottomSheet from the bottom
Labels: c: new feature,framework,f: material design,c: proposal,team-design,triaged-design

## Use case

I'd like to reproduce the design seen here, with the BottomSheet being a sort of floating box :
![image](https://user-images.githubusercontent.com/91450931/161721061-6dc4d823-ed5b-4014-a05d-128a2b2213d9.png)

## Proposal
Provide a `bottomOffset` parameter of type `double` to `showModalBottomSheet` and other widgets/functions of the kind, or better yet an object allowing for even more customization.

This is doable right know with a custom dialog, but i'd be better not to do that and rely on Flutter widgets instead. Thanks !
Repository: pytorch
Issue: Potential runtime optimization of Mish activation
Labels: feature,module: nn,triaged,module: python frontend

### 🚀 The feature, motivation and pitch

Mish is a quite popular activation function. It is defined as a tanh of a softplus. Softplus is in turn defined as softplus(x) = log(1+exp(x)). Tanh is defined in terms of exponential functions. Logarithms and exponentials cancel out.

By doing algebraic manipulation one can prove that an equivalent function is mish(x) = x*(1-2/(1+(1+exp(x))^2).
Current implementation is mish(x) = x*(tanh(softplus(x))

The backward implementation could also be manipulated in a similar way to possibly get a speedup.

Since this is only an optimization all code should already have tests

The potential benefit of this method is
1) Fewer "expensive" function invocations, (one expensive + a couple of standard ops vs. 2 expensive invocations)
2) Less branching code. Due to numerical instability softplus is approximated as a masked linear function for large inputs
3) Possibly better better numerical accuracy, each "expensive" invocation tend to have some rounding errors, therefore by using two of these might lead to larger errors.

The potential drawbacks are
1) Implementation would not look like the corresponding paper.

Suggestion:
Rewrite:
In aten/native/cuda/Activation.cu
mish_kernel
mish_backward_kernel

In caffe2/operators/mish_op.cc
MishFunctor
MishGradientOp

- Do some benchmarking to verify speedup

If you are interested I could do the implementation

Best
  David

### Alternatives

Not doing anything

### Additional context

_No response_

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345
Repository: PowerToys
Issue: More actions on the touchpad configuration
Labels: Idea-Enhancement,Needs-Triage,Product-Mouse Utilities

### Description of the new feature / enhancement

Hello, 

I have a friend with a huge disability.

He still uses Windows Seven because windows 10 and 11 do not allow to configure the touchpad as he would need.

Would it be possible in the powertoys to define the tap actions on the touchpad with one finger, two fingers, etc...?

In our case, it needs the tap with one finger to perform a right click.

Thank you.



### Scenario when this would be used?

Evry day for every use for a lot of handicap person's.

### Supporting information

_No response_
Repository: terminal
Issue: Unable to search as "Terminal" when It is displayed as "终端"
Labels: Product-Terminal,Tracking-External,Area-Localization

Title: Unable to search as "Terminal" when Terminal is displayed as "终端"
Version: 1.12.10733.0
Windows version: Windows 11 workstation 21H2 22000.527
Description:

Once the Terminal upgrade the Chinese language, the name switch to "终端". Then you'll be not able to search it as "Terminal".

![image](https://user-images.githubusercontent.com/35056356/161735599-7a79057b-8e98-4f13-993f-eea11338c3da.png)
![image](https://user-images.githubusercontent.com/35056356/161735626-1a5ff5b1-22c4-41aa-95c0-8843021b3a75.png)

For modern UWP application, it usually can be search as English even if it has alternative traslation. the searches of Mail exemplify this situation.

![image](https://user-images.githubusercontent.com/35056356/161735952-9311f01f-350c-40a9-bef2-015d9b8b15da.png)
Repository: flutter
Issue: ignore test coverages by default
Labels: a: tests,tool,c: proposal,P3,team-tool,triaged-tool

When creating a new app the template `.gitignore` file does not ignore `coverage` directory
I think it should be ignored by default
Repository: vscode
Issue: Can't type in Cmd+` in Keyboard Shortcut UI
Labels: upstream,keybindings,macos

Issue Type: <b>Bug</b>

Open Keyboard Shortcuts tab. Click to edit any. In the input try holding Cmd and press '`' key. It is not appearing in the input field.

Workaround: enter any non-existing combo (like shift-`), then open Keyboard Shortcuts JSON and find that entry, replace string to "cmd+`".

VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T14:42:05.236Z)
OS version: Darwin arm64 21.1.0
Restricted Mode: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M1 Pro (8 x 24)|
|GPU Status|2d_canvas: enabled<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: enabled<br>opengl: enabled_on<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|3, 3, 3|
|Memory (System)|32.00GB (0.08GB free)|
|Process Argv|--crash-reporter-id 7c274816-b412-4d9f-ad5b-d50b8a8f63bf|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (26)</summary>

Extension|Author (truncated)|Version
---|---|---
jest-snippets|and|1.8.0
csharpier-vscode|csh|1.2.1
xml|Dot|2.5.1
es7-react-js-snippets|dsz|4.4.3
gitlens|eam|12.0.5
prettier-vscode|esb|9.5.0
unity-code-snippets|kle|1.3.0
vscode-docker|ms-|1.21.0
csharp|ms-|1.24.3
vscode-kubernetes-tools|ms-|1.3.7
python|ms-|2022.4.0
vscode-pylance|ms-|2022.3.4
jupyter|ms-|2022.2.1030672458
jupyter-keymap|ms-|1.0.0
jupyter-renderers|ms-|1.0.6
remote-containers|ms-|0.231.3
vsliveshare|ms-|1.0.5449
vscode-yaml|red|1.6.0
html-to-jsx|ria|0.0.1
scala|sca|0.5.5
metals|sca|1.13.0
prettier-vscode|Sim|2.0.7
paste-clean-diff|siv|1.1.0
unity-debug|Uni|3.0.2
errorlens|use|3.4.2
propertylist|zho|0.0.2


</details>
<!-- generated by issue reporter -->
Repository: deno
Issue: Connect to AF_UNIX Socket in SOCK_DGRAM mode
Labels: public API,suggestion

I have been trying a lot to find the correct way of doing this, but didn't come up with a solution. I hope you can either point me to the correct resources or verify my current understanding that this is currently not possibly with Deno.

I'd like to connect to an existing socket of type `AF_UNIX` and `SOCK_DGRAM` and let my application talk to it. Example use cases are logging to syslog via UDP messages to `/dev/log` or letting a Deno application running as systemd service communicate with systemd, for example to utilize the built-in watchdog mode.

`Deno.connect()` allows to connect to a `AF_UNIX` socket as unstable feature, but it does so in `SOCK_STREAM` mode. `Deno.listenDatagram()` is not an option because it tries to remove an already existing socket and register a new one at the location.

I suppose we would need something like `Deno.connectDatagram()` for this to work. I spent some time looking into the current implementations of `Deno.listen()`, `Deno.connect()` and `Deno.listenDatagram()` and from what I can see the underlying libraries should already support doing so - I may be horribly wrong, though, this is my first investigation into Deno source code.

Is there any reason why we do not yet have a `Deno.connectDatagram()` besides it not being a priority feature so far? If one were to implement that feature and make a PR, is `Deno.connectDatagram()` a proper way to do this or would you prefer to have this integrated into `Deno.connect`?
Repository: rust
Issue: unwrap_unchecked is slower than unwrap in benchmarks
Labels: I-slow,C-bug

[The repository](https://github.com/KalitaAlexey/test_return_self) containing the code.

OS: Windows 11 + WSL2.

The output:
```
test test_16::mutate_self          ... bench:      25,073 ns/iter (+/- 848)
test test_16::mutate_self_unsafe   ... bench:      59,982 ns/iter (+/- 879)
test test_16::return_self          ... bench:      14,797 ns/iter (+/- 416)

test test_32::mutate_self          ... bench:      48,684 ns/iter (+/- 6,065)
test test_32::mutate_self_unsafe   ... bench:      65,185 ns/iter (+/- 14,250)
test test_32::return_self          ... bench:      20,893 ns/iter (+/- 780)

test test_64::mutate_self          ... bench:      68,974 ns/iter (+/- 2,896)
test test_64::mutate_self_unsafe   ... bench:      68,850 ns/iter (+/- 9,081)
test test_64::return_self          ... bench:      33,796 ns/iter (+/- 5,718)

test test_128::mutate_self         ... bench:      94,783 ns/iter (+/- 7,628)
test test_128::mutate_self_unsafe  ... bench:     106,939 ns/iter (+/- 4,786)
test test_128::return_self         ... bench:      57,526 ns/iter (+/- 751)

test test_256::mutate_self         ... bench:     122,306 ns/iter (+/- 6,652)
test test_256::mutate_self_unsafe  ... bench:     143,735 ns/iter (+/- 17,184)
test test_256::return_self         ... bench:     145,899 ns/iter (+/- 7,491)

test test_512::mutate_self         ... bench:     166,415 ns/iter (+/- 36,866)
test test_512::mutate_self_unsafe  ... bench:     174,201 ns/iter (+/- 29,308)
test test_512::return_self         ... bench:     208,695 ns/iter (+/- 30,022)

test test_1024::mutate_self        ... bench:     221,598 ns/iter (+/- 5,588)
test test_1024::mutate_self_unsafe ... bench:     222,193 ns/iter (+/- 13,501)
test test_1024::return_self        ... bench:     277,051 ns/iter (+/- 2,970)
```

Given, `unwrap_unchecked` uses `unreachable!`, I'd expect at least similar performance.