sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Criterion hangs the process because for some reason the server socket can’t detect that client has closed connection
Labels: T-libs,S-needs-repro

I am not sure if the issue is with criterion or the std library so i have raised it in both projects, criterion does not seem to be getting picked up also. Hoping someone here can at least establish what is causing this std or criterion

[Criterion Ticket](https://github.com/bheisler/criterion.rs/issues/726)

This only happens on Linux but works fine on Darwin and when criterion is used to do clt.read , however when a standard for loop is used all works fine

- Example contains a main function which in-turn calls two for the most part identical functions

```rust
let _ = clt2svc_without_criterion();
let _ = clt2svc_with_criterion();
```

- Both functions have the same objective

- create and connect two non-blocking TcpStream’s to each other
   -   **clt** TcpStream, will connect from **main** thread
   -  **svc** TcpStream, will be accepted from **Svc-Thread** thread
- **svc** TcpSteam will continually write to the socket untill it gets an **io::std::Error**
- **clt** TcpStream will continually read N number of times and then issue **clt.shutdown(Shutdown::Both)**
- The only difference between two functions is one uses criterion to measure the read speed and the other a standard for loop. However the one that uses criterion variant hangs as the svc TcpStrem gets **ErrorKind::WouldBlock** instead of **ErrorKind::BrokenPipe**

[Full Example](https://hackmd.io/@sAjRm9zlSC2g1or0Y1nPyg/SkAKIDs1p)
Repository: godot
Issue: Geometry2D.IsPointInPolygon incorrectly reports point inside of polygon 
Labels: bug,topic:core,confirmed,topic:2d

### Godot version

4.1.1-stable [bd6af8e0ea69167dd]

### System information

Godot v4.1.1.stable.mono (bd6af8e0e) - Ubuntu 22.04.3 LTS 22.04 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4080 () - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)

### Issue description

Geometry2D.IsPointInPolygon incorrectly reports a point lies inside of a polygon, when it clearly lies outside of it. 

Here is the perimeter of the polygon:
![Screenshot from 2023-09-25 06-14-33](https://github.com/godotengine/godot/assets/12498487/9bd709ad-19cd-42eb-83b4-0b92475ed1f6)

Here I have printed out the result of Geometry2D.IsPointInPolygon() for all points within a range:
![Screenshot from 2023-09-25 06-08-47](https://github.com/godotengine/godot/assets/12498487/5333b671-888a-4b7a-8f0d-f4016537aed7)

As you can see, there is a rogue pixel in the top left quadrant.

### Steps to reproduce

I've created the following repro. Simply attach this script to a Node2D and it will fail with: "Error found in Geometry2D.IsPointInPolygon". Note: I'm generating all the vertices (there are around 250), but I can also provide a text file with each individual vertex if necessary.
    
    using System;
    using System.Collections.Generic;
    using Godot;

    public partial class Repro : Node2D
    {
        public override void _Ready() {
            int radius = 40;
            int height = 100;
            Vector2 center = new(radius, height * 0.5f);
            var vertices = Capsule(center, radius, height);

            if (Geometry2D.IsPointInPolygon(new Vector2(29, 16), vertices)) {
                throw new Exception("Error found in Geometry2D.IsPointInPolygon");
            }
        }

        private static Vector2[] Capsule(Vector2 center, float radius, float height) {
            int vertexCount = (int)Math.Ceiling(Math.PI * radius);
            var vertices = new List<Vector2>();

            // Bottom of the capsule
            for (int i = 0; i <= vertexCount; ++i) {
                double phi = Math.PI / vertexCount * i;
                Vector2 v = new Vector2((float)Math.Cos(phi), (float)Math.Sin(phi)) * radius;
                v.Y += center.Y + height * 0.5f;
                v.X += center.X;
                vertices.Add(v);
            }

            // Top half-circle of the capsule
            for (int i = vertexCount; i >= 0; --i) {
                double phi = -Math.PI / vertexCount * i;
                Vector2 v = new Vector2((float)Math.Cos(phi), (float)Math.Sin(phi)) * radius;
                v.Y += center.Y - height * 0.5f + 2 * radius;
                v.X += center.X;
                vertices.Add(v);
            }

            return vertices.ToArray();
        }
    }
Repository: flutter
Issue: BUG: PWA dont work offline in Safari IOS
Labels: platform-web,has reproducible steps,P2,browser: safari-ios,team-web,triaged-web,found in release: 3.13,found in release: 3.15

### 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

1. open any web example(found in the flutter documentation) in IOS Safari, for example: https://gallery.flutter.dev/#/
2. install the PWA
3. open it, it will work correctly with network connection
4. close it, turn off your network connection and then open it again
5. you will see a blank screen or something similar, it doesn't load any content
6. It's seems like a bug

### Expected results

It should work offline on IOS Safari since it works on Android Chrome

### Actual results

Blank screen

### Code sample

You can use any flutter official live example found in the documentation, for example:

- https://gallery.flutter.dev/#/
- https://flutter.github.io/samples/web/simplistic_editor/
- https://flutter.github.io/samples/web/material_3_demo/

### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

It's not necessary. The problem can be reproduced with the following official examples:

- https://gallery.flutter.dev/#/
- https://flutter.github.io/samples/web/simplistic_editor/
- https://flutter.github.io/samples/web/material_3_demo/
Repository: go
Issue: proposal: x/net/websocket: Add proxy support
Labels: Proposal

I'd like to add proxy support to websocket.

In the `client.go` there is `NewClient` function which I think I need to change to add support for connection through proxy.
The way I see it is to add something along the lines of
```
	if (config.Proxy != nil) {
		err = newProxyConn(config.Proxy)
                if err != nil {
		    return
	        }
	}
```
before `err = hybiClientHandshake(config, br, bw)` call.
Function `newProxyConn` will basically send a `CONNECT` request to the proxy server and then websocket will proceed.
This of course will require `Proxy` to be added to `Config` struct.

This seems too easy to be true. I'm new to `golang` and probably missing something. All comments and suggestions are welcome.
Repository: godot
Issue: [2D Physics] RigidBody2D breaks when on a StaticBody2D and Engine.time_scale is set to 0
Labels: topic:physics,needs testing,topic:2d

### Godot version

4.1.1 stable

### System information

Godot v4.1.1.stable unknown - Artix Linux - Vulkan (Compatibility) - Mesa Intel(R) HD Graphics 4000 (IVB GT2) () - Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz (4 Threads)

### Issue description

Setting Engine.time_scale to 0 while a non-sleeping RigidBody is on a StaticBody sets all Node2D properties from the RigidBody to nan. Note that this does not happend with SceneTree.paused.
![2023-09-25T16:34:45,189553305+02:00](https://github.com/godotengine/godot/assets/92468390/f8448bc6-8f4b-47d3-a8f7-e6b7a9b62c2d)


### Steps to reproduce

1. Run the MRP
2. Press space bar when the RigidBody is on top of the StaticBody. This should set Engine.time_scale to 0
3. The RigidBody should disappear and have their Node2D properties set to nan 

### Minimal reproduction project

[crash.zip](https://github.com/godotengine/godot/files/12716680/crash.zip)
Repository: flutter
Issue: TextSpan position and sizing API
Labels: c: new feature,framework,a: typography,c: proposal,P3,team-framework,triaged-framework

### 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)

### Use case

This is basically a continuation of https://github.com/flutter/flutter/issues/32137, which was closed due to OP not giving requested feedback.

The use case is displaying an arbitrary widget relative to some `TextSpan` inside a `SelectableText.rich()`:

<img width="849" alt="image" src="https://github.com/flutter/flutter/assets/39827040/6a4ceaed-7a88-40ca-b881-947ecb15dcd1">

The screenshot is created by:
- cloning the SDK `TextPainter`'s entire text_painter.dart file
- adding a `late Paragraph` property
- assigning to it the currently only local result from `_createParagraph` inside `layout()`
- using this custom `TextPainter` in a `CustomPaint`
- accessing `paragraph.getBoxesForRange()` after `layout()` was called
- `canvas.drawCircle()` with the obtained coordinates

All this still leaves us without being able to select any of the text and without the ability to render an actual widget in place of the dot.

### Proposal

Ideally, `TextSpan` would expose a `void Function(Iterable<TextBox> boxes) onPositioned` callback, allowing us to run additional logic once the information is available.
Repository: storybook
Issue: [Bug]: Adding more than one radio per story results in shared ids
Labels: bug,needs triage

### Describe the bug

When creating a doc with more than one radio, unique ids are not created for each set of radios. The problem is you can't set default radio form values for the subsequent controls. 



### To Reproduce

Using the next/typescript sandbox, I updated the Button.tsx file to take two props with a set of choices. The autodocs generate two radio groups and you can see the ids are the same between each group. `control-type-{n}`

```
import React from 'react';
import './button.css';

interface ButtonProps {
  /**
   * Is this the principal call to action on the page?
   */
  primary?: boolean;
  /**
   * What background color to use
   */
  backgroundColor?: string;
  /**
   * How large should the button be?
   */
  size?: 'small' | 'medium' | 'large';
  /**
   * How large should the button be?
   */
  type?: 'primary' | 'secondary' | 'tertiary';
  /**
   * Button contents
   */
  label: string;
  /**
   * Optional click handler
   */
  onClick?: () => void;
}

/**
 * Primary UI component for user interaction
 */
export const Button = ({
  primary = false,
  size = 'medium',
  type = 'primary',
  backgroundColor,
  label,
  ...props
}: ButtonProps) => {
  const mode =
    type === 'primary'
      ? 'storybook-button--primary'
      : type === 'secondary'
      ? 'storybook-button--secondary'
      : 'storybook-button--tertiary';
  return (
    <button
      type="button"
      className={['storybook-button', `storybook-button--${size}`, mode].join(
        ' '
      )}
      {...props}
    >
      {label}
      <style jsx>{`
        button {
          background-color: ${backgroundColor};
        }
      `}</style>
    </button>
  );
};
```

### System

```bash
Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
  Binaries:
    Node: 17.9.1 - ~/.nvm/versions/node/v17.9.1/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v17.9.1/bin/npm
  Browsers:
    Chrome: 116.0.5845.187
    Edge: 117.0.2045.40
    Safari: 15.6.1
  npmPackages:
    @storybook/addon-essentials: ^7.4.5 => 7.4.5 
    @storybook/addon-interactions: ^7.4.5 => 7.4.5 
    @storybook/addon-links: ^7.4.5 => 7.4.5 
    @storybook/addon-onboarding: ^1.0.8 => 1.0.8 
    @storybook/addon-styling: ^1.3.7 => 1.3.7 
    @storybook/blocks: ^7.4.5 => 7.4.5 
    @storybook/nextjs: ^7.4.5 => 7.4.5 
    @storybook/react: ^7.4.5 => 7.4.5 
    @storybook/testing-library: ^0.2.1 => 0.2.1
```


### Additional context

_No response_
Repository: next.js
Issue: when using a variable to insert an attribute name in a styled-jsx block, an invalid CSS attribute is being rendered
Labels: bug

### Link to the code that reproduces this issue

https://github.com/EmLXND/styled-jsx-variable-bug

### To Reproduce

1. Start application in development (`next dev`)
2. Inspect the div that wraps both heading and paragraph

### Current vs. Expected behavior

I expect no CSS attribute to have rendered, but I can observe an invalid CSS attribute in the dev tools. (": 0")

<img width="144" alt="image" src="https://github.com/vercel/next.js/assets/12788491/d5a8ea1c-af3c-4f71-aa7c-9a1753a1ccf9">

**this causes following attributes not to be applied**


### 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: x64
  Version: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
Binaries:
  Node: 16.15.0
  npm: 8.5.5
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 13.5.3-canary.4
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Not sure

### Additional context

I tried to reproduce on the latest canary releases and the first canary release that introduced the issue was [13.4.20-canary.32](https://github.com/vercel/next.js/releases/tag/v13.4.20-canary.32)
Repository: rust
Issue: Missed optimization when removing intermediate
Labels: A-LLVM,I-slow,T-compiler

Using Rust 1.72.0:

```rust
pub fn f(err: i32) -> Result<u16, i32> {
    if err < 0 {
        return Err(err);
    }
    
    Ok(err as u16)
}
```

compiles to:

```asm
example::f:
        mov     ecx, edi
        shl     ecx, 16
        xor     eax, eax
        test    edi, edi
        cmovns  eax, ecx
        mov     ecx, edi
        shr     ecx, 31
        shl     rdi, 32
        or      rax, rdi
        or      rax, rcx
        ret
```

But adding an intermediate before the conditional appears to help:

```rust
pub fn f(err: i32) -> Result<u16, i32> {
    let ok = err as u16;

    if err < 0 {
        return Err(err);
    };
    
    Ok(ok)
}
```

compiles to:

```asm
example::f:
        mov     ecx, edi
        shr     ecx, 31
        mov     rax, rdi
        shl     rax, 32
        shl     edi, 16
        or      rax, rdi
        or      rax, rcx
        ret
```

https://godbolt.org/z/bf6jW9d3c

This intermediate could be an argument in a call, which is in fact how I originally noticed it, i.e. this:

```rust
fn to_result_ok<T>(err: i32, ok: T) -> Result<T, i32> {
    if err < 0 {
        return Err(err);
    }
    
    Ok(ok)
}

pub fn f(ret: i32) -> Result<u16, i32> {
    to_result_ok(ret, ret as u16)
}
```

compiles better than:

```rust
pub fn f(ret: i32) -> Result<u16, i32> {
    if ret < 0 {
        return Err(ret);
    }

    Ok(ret as u16)
}
```
Repository: godot
Issue: 3D Shaders are always updating but not in 2D
Labels: bug,topic:editor,topic:shaders,topic:2d

### Godot version

v4.1.1.stable.mono.official [bd6af8e0e]

### System information

Godot v4.1.1.stable.mono - macOS 13.5.2 - Vulkan (Forward+) - integrated Apple M2 Pro - Apple M2 Pro (12 Threads)

### Issue description

Shaders that have UV scrolling by time are always refreshing in 3D editor scene, but not in 2D editor scene.

Side note: I can also reproduce the bug on my Windows 10 I7-7700k 970 GTX 16Go RAM.

### Steps to reproduce

You can create a simple visual shader with those nodes : 

<img width="1066" alt="image" src="https://github.com/godotengine/godot/assets/7771426/a2c77be8-2be4-45cd-abc2-69d1b381aa17">

What it happens in 2D view, the material doesn't scroll, even if I move in the scene : 

![bug_scroll_2D](https://github.com/godotengine/godot/assets/7771426/c0f5b3df-7046-45f1-a4ba-45bda2fdc83d)

What it happens in 3D view, the material is always scrolling : 

![bug_scroll_3D](https://github.com/godotengine/godot/assets/7771426/8f22cc3e-63e1-4e82-8907-9918156f0704)

Actually, I don't know which behaviour is really intended. Due to performance lacks, I think the shader shouldn't update in the 3D view, or at least allow the view to refresh or not (like a "Always refresh" toggle option from the scene context top-left menu).



### Minimal reproduction project

Project to reproduce the bug : [GodotScrollShaderBug.zip](https://github.com/godotengine/godot/files/12717084/GodotScrollShaderBug.zip)
Repository: transformers
Issue: Implementation of Git-Rebasin to Huggingface models
Labels: New model

### Feature request

Hi, 

I am not sure if this is even feasible/appropriate request in Huggingface. Recently, there was an ICLR paper titled "Git Rebasin" (https://arxiv.org/abs/2209.04836) which demonstrates a method to effectively merge models.

But the authors have implemented it only for plain NN and Resnet kind of architectures. It would be really great if this feature is supported for Huggingface models as there'll be lots of instances where we might need to merge the models and a naive way of adding is not the best way.   

### Motivation

This feature is helpful especially in federated learning where 2 different people train 2 models separately and would like to combine their models. 

In academic circles as well, this is very much useful as there'll be lots of instances where effective model merging is critical! 

### Your contribution

I've raised PR's in subsequent Github repos

1. https://github.com/samuela/git-re-basin/issues/13#issue-1910375545
2. https://github.com/themrzmaster/git-re-basin-pytorch/issues/8#issue-1910392068

Not sure if this is feasible based on some of the previous discussions as the paper is based on "Permutation Invariance" of model weights and an architecture like Llama might have various possibilities thus difficulty in the method.

I would be happy to contribute if there's some help!
Repository: storybook
Issue: [Bug]: If build breaks in non-TTY mode, SB hangs
Labels: bug,needs triage

### Describe the bug

In a new project, which hasn't been setup for telemetry, if you build storybook in a mode without a TTY (e.g. chromatic) it will prompt to send telemetry and hang.


### To Reproduce

1. Create a new storybook
2. Make it error (e.g. throw in `viteFinal` or `webpackFinal`)
3. Run a storybook build in a non-TTY (e.g. via Chromatic)
4. Notice the SB never builds and hangs

I'm not sure of the best way to simulate the Chromatic build with a single shell command, there's probably a way though.

### System

_No response_

### Additional context

_No response_
Repository: pytorch
Issue: tan/tanh discrepancies with complex due to jiterator
Labels: module: cuda,triaged,module: jiterator

### 🐛 Describe the bug

There is perhaps a large discrepancy (requiring atol being increased to 3e-4) between the before+after #102427 implementation of tan/tanh on CUDA with complex values.

Repro:
```
import torch
x = torch.tensor(-7.8167-0.0451j, device='cuda:0')
torch.set_printoptions(precision=10)
print(torch.tan(x))
print(torch._foreach_tan([x])[0])
print(torch._foreach_tan([x.to(device="cpu")])[0])
```

Before:
![image](https://github.com/pytorch/pytorch/assets/31798555/0666808c-eb85-490d-b12e-51720a9f828c)

After:
![image](https://github.com/pytorch/pytorch/assets/31798555/193b312e-ff18-4b8e-9a65-3597f702c41f)

I happened to observe this when debugging why some tan tests were failing when I added new sample inputs to the foreach tests in https://github.com/pytorch/pytorch/pull/109402#discussion_r1333562975. 

### Versions

trunk

cc @ptrblck @mruberry @parth-desai @peterbell10
Repository: flutter
Issue: [cocoon] List currently breaking task on the dashboard first even while rerunning
Labels: team-infra,P3,triaged-infra

When the tree is red, the failing check is usually listed first in the grid of tasks on https://flutter-dashboard.appspot.com/#/build

However, when the check is rerunning to potentially de-flake a failing task, it is not listed first. So currently the tree is broken but I cannot find and check the logs for the failing build while it is rerunning. 

![image](https://github.com/flutter/flutter/assets/16964204/15d2a5be-6f88-4ee5-bccf-962bce29bdf2)

I know I can search for it to find it, it is listed in the heading - but it is further sticky in that he title is truncated and I cannot select it. (Filing separate issue for this: https://github.com/flutter/flutter/issues/135440)
Repository: flutter
Issue: [cocoon] Enable some way to copy failing task name to clipboard for search/filter
Labels: team-infra,P3,triaged-infra

Related to https://github.com/flutter/flutter/issues/135439

Since the failing check that is currently rerunning is not listed first (see other issue listed above), in order to find the failing task I need to search for it. The name of the task is in the app bar of the dashboard, but it is not selectable. If I could just copy the name of the task to the clipboard, it would be really easy to find it and check the logs.

I know a tooltip will display the full name btw, it is also not selectable.

There are probably a couple of different ways to do this:
- click on the name to copy to clipboard
- make the name selectable
- When there are multiple checks failing, maybe open a drop down menu to display+click to copy the name
- Maybe clicking the tooltip name will copy to clipboard
- Something else entirely. :)

![image](https://github.com/flutter/flutter/assets/16964204/7157851d-4dba-4d68-9bf3-fa58c7db262a)