sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [feature request] Rank-Revealing QR - Adding dgeqp3 support to torch.qr
Labels: todo,feature,triaged,module: linear algebra,actionable

## Issue description

PyTorch currently does not QR decomposition with pivots, which is useful in the context of rank identification.

This can be done with the current setup using `SVD`, but is much less efficient than a QR decomposition.

Given the availability of `orgqr` and `geqrf` as direct calls, I assume that `torch.qr` is implemented using those. Support for [`dgeqp3`](http://www.netlib.org/lapack/explore-html/dd/d9a/group__double_g_ecomputational_ga1b0500f49e03d2771b797c6e88adabbb.html#ga1b0500f49e03d2771b797c6e88adabbb) (QR with pivots) would be a nice addition.

Scipy's implementation of [`sp.linalg.qr`](https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.linalg.qr.html) supports pivoting through the `pivot=True` argument and a call to [`dgeqp3`](http://www.netlib.org/lapack/explore-html/dd/d9a/group__double_g_ecomputational_ga1b0500f49e03d2771b797c6e88adabbb.html#ga1b0500f49e03d2771b797c6e88adabbb)

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano @vishwakftw @SsnL
Repository: go
Issue: cmd/go: provide straightforward way to see non-test dependencies
Labels: NeedsInvestigation,modules

It's important to be able to see the full set of dependencies used by production code exclusive of tests, particularly with different major versions as distinct modules, as inadvertently using an import with a different major version can introduce bugs (also, some external dependencies can be toxic to have in production code).

The `go mod why` command provides a `-vendor` flag to exclude tests; perhaps `go list` could provide a similar flag to exclude testing dependencies.

In addition to the above, it is also useful to be able to be able to see modules used by local production code and tests, but not transitively by tests in external dependencies, as external dependencies are harder to change, and inadvertently forked modules are still an issue for tests too. I'm not sure of a good way to specify that, though.
Repository: go
Issue: x/net/http2: Connection reset incorrectly in high load performance test
Labels: NeedsInvestigation

### What version of Go are you using (`go version`)?
golang:1.10.0 linux

### Does this issue reproduce with the latest release?
Yes

### What operating system and processor architecture are you using (`go env`)?
container: rhel
kubenet: 

### What did you do?
```
func (sc *serverConn) wroteFrame(res frameWriteResult) {
...
			sc.closeStream(st, errHandlerComplete)                  <=== _code1_
		}
...
	wr.replyToWriter(res.err)                                               <=== _code2_
...
}
```

**In some cases, the server goroutine will be switch out execution context between _code1_ and _code2_.
If the handler goroutine switch back to execution context in these cases, that will make writeDataFromHandler() (writeHeaders() also?) failed and set responseWriterState to dirty.**

```
func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStream bool) error {
...
	case <-stream.cw:
		// If both ch and stream.cw were ready (as might
		// happen on the final Write after an http.Handler
		// ends), prefer the write result. Otherwise this
		// might just be us successfully closing the stream.
		// The writeFrameAsync and serve goroutines guarantee
		// that the ch send will happen before the stream.cw
		// close.
		select {
		case err = <-ch:
			frameWriteDone = true
		default:
			return errStreamClosed
		}
	}
...
}
func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
...
		if err := rws.conn.writeDataFromHandler(rws.stream, p, endStream); err != nil {
			rws.dirty = true
			return 0, err
		}
...
}
```

**This issue can be reproduced easily if add sc.logf() between _code1_ and _code2_ in lower load performace test.
PS: I think in wroteFrame(), we shouldn'd call "wr.replyToWriter(res.err)" when closing stream with error. It will cause writeDataFromHandler() exit with no error. But in fact this stream/responseWriterState is already on incorrect status.**

### What did you expect to see?
no connection reset in load test

### What did you see instead?
connecttion reset and traffic failed beofre new connection set up
Repository: go
Issue: x/mobile: lifecycle.StageDead never reach on Android 
Labels: mobile

Please answer these questions before submitting your issue. Thanks!


### What version of Go are you using (`go version`)?

go version go1.8.1 darwin/amd64

### Does this issue reproduce with the latest release?
yes
### What operating system and processor architecture are you using (`go env`)?

GOARCH="amd64"
GOBIN="/Users/ntop/tools/go"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ntop/workspace/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/t6/8417qy4n2zn3lb370499nrl00000gn/T/go-build741486693=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
### What did you do?

Add following code in the [basic example](https://github.com/golang/mobile/blob/master/example/basic/main.go)

```
for e := range a.Events() {
			switch e := a.Filter(e).(type) {
			case lifecycle.Event:
				switch e.Crosses(lifecycle.StageAlive) {
				case lifecycle.CrossOn:
					log.Println("==========application create")
				case lifecycle.CrossOff:
					log.Println("==========application destroy")
				}
```
### What did you expect to see?

Both "==========application create" and "==========application destroy" should be printed.

### What did you see instead?

I see only "==========application create" printed.

According to the documentation at lifecycle.go, StageAlive: On Android, these correspond to onCreate and onDestroy. So `e.Crosses(lifecycle.StageAlive) == lifecycle.CrossOff` will be true when Activity.Destroy() is Called. But it just did not happen. I have read the code of 'android.go', it did't implement the onDestroy() method, and did not send any lifecycle.StageDead message.
Repository: godot
Issue: Undocumented thread (un)safety 
Labels: discussion,topic:core

As I commented in #18714 we have some basic concepts of thead safety documented in the docs.
I've been working on a procedural generator and trying to speed-up the generation. I decided to use multithreading but I have several doubts/problems.
context: I'm working using C++ GDN.

1. I'm using std::thread and OpenMP pragmas, does it have implications compared to the use of godot::Thread in relation to interacting with the engine API?

 2. I have the following code to generate some meshes:
```
Spatial *meshes_node = new Spatial;
//#pragma omp parallel for
for (int i = 0; i < meshDataArray.size(); i++) {
	const Array &arr = meshDataArray[i];
	MeshInstance *meshInst = new MeshInstance;
	meshInst->set_material_override(material);
	
	Ref<ArrayMesh> mesh_ref(new ArrayMesh);
	mesh_ref->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, arr);
	meshInst->set_mesh(mesh_ref);
	meshes_node->add_child(meshInst);
	meshInst->add_to_group(TERRAIN_MESH_GROUP_NAME);
	
}
m_world->root_node->add_child(meshes_node);
```
If I uncomment the #pragma it only generates the meshes processed by one thread. That's the reason of that? Do I have to generate it only with the main thread? Can that behaviour be circumvented using Nodes or the VisualServer?

3. Other code example, in this case is for collision generation:

```
Spatial *collisions_node = new Spatial;
//#pragma omp parallel for
for (int i = 0; i < meshDataArray.size(); i++) {
	const Array &arr = meshDataArray[i];
	Ref<ConcavePolygonShape> shape(new ConcavePolygonShape);
	shape->set_faces(arr[Mesh::ARRAY_VERTEX]);
	StaticBody *body = new StaticBody;
	int owner_id = body->create_shape_owner(body);
	body->shape_owner_add_shape(owner_id, shape);
	collisions_node->add_child(body);
	body->add_to_group(BODIES_GROUP_NAME);
}
m_world->root_node->add_child(collisions_node);
```

After removing the comment in the pragma te generation of concave collisions is way faster (without multithreading takes some seconds to complete) but the generation is unrealiable, it sometimes finishes and sometimes crashes with the following error:

> ERROR: get: Condition ' !id_map.has(p_rid.get_data()) ' is true. returned: __null
>    At: core/rid.h:155.
> ERROR: shape_set_data: Condition ' !shape ' is true.
>    At: modules/bullet/bullet_physics_server.cpp:146.
> ERROR: get: Condition ' !id_map.has(p_rid.get_data()) ' is true. returned: __null
>    At: core/rid.h:155.
> ERROR: body_add_shape: Condition ' !shape ' is true.
>    At: modules/bullet/bullet_physics_server.cpp:503.
> handle_crash: Program crashed with signal 11

What's the cause of this error? Do I need to use the PhysicsServer in order to have a safe concurrent access?

This class is being loaded as a Singleton and the docs say [it's safe to access the server in that case](https://godot.readthedocs.io/en/latest/tutorials/threads/thread_safe_apis.html#global-scope). What about nodes as in my examples?
Repository: TypeScript
Issue: Contradicting types in tooltip and type checker when inference fails and when using @ts-ignore
Labels: Bug

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.1.0-dev.20180802

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** inference fail assignability

**Code**
When ignoring an inference error using `//@ts-ignore`, Intellisense and the type checker seem to contradict each other.
```ts
// ===============
// utility types:

// taken from https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-322267089
type NoInfer<T> = T & {[K in keyof T]: T[K]};

/**
 * Tests if two types are equal
 */
export type Equals<T, S> =
	[T] extends [S] ? (
		[S] extends [T] ? true : false
	) : false
	;

// =================
// actual repro

const testFn1 = <T>(arg1: T, arg2: NoInfer<T>) => arg2 as T;
// @ts-ignore: this is an intentional error
const test1 = testFn1({ a: 1 }, { b: 2 });
// ^ because we forbid to infer T from arg2, test1 is inferred as {}
// otherwise we would get a union type

type Test1 = Equals<typeof test1, { a: 1 }>; // false
const success1: Test1 = true; // no error, although typeof success1 is false
const success2: Test1 = false; // error: Type "false" is not assignable to "true", although typeof success2 is false
```

**Expected behavior:**
`false` is assignable to a variable which (according to the tooltip) has type `false`.
`true` is not assignable to a variable which (according to the tooltip) has type `false`.

**Actual behavior:**
`false` **is not** assignable to a variable which (according to the tooltip) has type `false`.
`true` **is** assignable to a variable which (according to the tooltip) has type `false`.
![unbenannt](https://user-images.githubusercontent.com/17641229/44037156-e4c71b96-9f13-11e8-84ef-e37ef1f69ee1.png)
![unbenannt2](https://user-images.githubusercontent.com/17641229/44037159-e5fb4eb0-9f13-11e8-9664-70bf18add36b.png)

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
Maybe https://github.com/Microsoft/TypeScript/issues/17863 at a first glance
Repository: pytorch
Issue: Type name float registered twice. This should not happen. Do you have duplicated CAFFE_KNOWN_TYPE?
Labels: caffe2

This is a tracking issue for issues in PyTorch related to runtime errors people may see when they build and install PyTorch and Caffe2 separately latest PyTorch master. This is caused by https://github.com/pytorch/pytorch/pull/10163 and it is **expected.** The solution is to stop building and installing PyTorch and Caffe2 separately; instead use `FULL_CAFFE2=1`. If you use the ONNX scripts after #10427.

I may update this space with more information as it happens.

If we add other static initializer registry type things, the `CAFFE_KNOWN_TYPE` initializer may not run first. We need to add appropriate error checking at all static initializer sites.

CC @yinghai @Yangqing
Repository: pytorch
Issue: Key already registered. Offending key: caffe2_print_stacktraces.
Labels: caffe2

This error occurs if you install a `FULL_CAFFE2` build of PyTorch (e.g., `FULL_CAFFE2=1 python setup.py develop`), as well as another build of Caffe2 (e.g., `python setup_caffe2.py develop`)

`pip uninstall caffe2` is NOT sufficient to fix the problem. You will need to delete `caffe2/python/caffe2_pybind11_state.cpython-36m-x86_64-linux-gnu.so` (or similar) at least; a more reliable way to fix the problem is to clean your local build and try again.
Repository: go
Issue: proposal: cmd/go: add signal for `go get -u` to track branch
Labels: Proposal,GoCommand,modules

Hi everyone, 

I already posted an issue regarding go.mod files.
https://github.com/golang/go/issues/26640

This one is a little bit different but little bit linked to that old one.

I'm actually developping multiple repositories using 2 branches **master** and **dev**. Those branches are defined for each repositories. Lets assume I have the following ones:

- **myrepo1 (dev and master) using myrepo2**
- **myrepo2 (dev and master)**

I was wondering if there is a way to specify a branch for a specific repository inside the go.mod file.
For instance:

```
module github.com/myrepo1

require (
	github.com/myrepo2 v@sometag or @somebranch
}
```
The reason why I'm asking that is that, when I'm actually runing the `go mod -sync` cmd in my **repo2**, it will always check for the last commit in master (or maybe I'm wrong?). But I would like that it looks into my **dev branch** for the last commit.

So I was thinking that maybe I can **tag** my dev branch and then specify the version I want to grab but it means that I will need to tag everytime I want to test my dev branch.

Does anyone have already face that pb?

Hope my explanations are clear :s

Thanks in advance ! :)
@rsc
Repository: pytorch
Issue: caffe2 CI does not test header install
Labels: caffe2

This meant we did not catch #10463
Repository: TypeScript
Issue: Improve diagnostic when string from property is not assignable to string literal.
Labels: Suggestion,Help Wanted,Effort: Moderate,Domain: Error Messages

**TypeScript Version:**  3.1.0-dev.20180810

**Code**

```ts
interface IceCreamOptions {
    readonly cherry: "yes" | "no"
}
declare function iceCream(options: IceCreamOptions): void;
const options = { cherry: "yes" };
iceCream(options);
```

**Expected behavior:**

Error message recommending to add a type annotation to `options`.  This should be detectable because the source of the failing property is a `PropertyAssignment` in an object literal being assigned to a variable. (If there is no variable assignment, we could still recommend using ``"yes" as "yes"` although that isn't as pretty.)
Could also come with a codefix. Note that in JS the fix is slightly different: put `/** @type {IceCreamOptions} */` before the `const` or use `/** @type {"yes"} */ ("yes")`.

**Actual behavior:**

Error messages says `Type 'string' is not assignable to type '"yes" | "no"'.` with no information on how to fix it.
Repository: pytorch
Issue: [Caffe2] Multithreading in Caffe2
Labels: caffe2

I am trying to implement a multithreading approach in Caffe2, but I got these errors:

```
E0809 13:54:40.390210 101295 net_async_scheduling.cc:213] Detected concurrent runs
E0809 13:54:40.390240 101295 net.h:57] Failed to execute async run
Exception in thread thread2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/alfred/catkin_ws/src/live_pytorch/src/segmenter.py", line 119, in worker
    densepose(data)
  File "/home/alfred/catkin_ws/src/live_pytorch/src/segmenter.py", line 77, in densepose
    cls_boxes, cls_segms, cls_keyps, cls_bodys = infer_engine.im_detect_all(model, cv_image, None, timers=timers)
  File "/home/alfred/exp/DensePose/detectron/core/test.py", line 58, in im_detect_all
    model, im, cfg.TEST.SCALE, cfg.TEST.MAX_SIZE, boxes=box_proposals
  File "/home/alfred/exp/DensePose/detectron/core/test.py", line 158, in im_detect_bbox
    workspace.RunNet(model.net.Proto().name)
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 219, in RunNet
    StringifyNetName(name), num_iter, allow_fail,
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 180, in CallWithExceptionIntercept
    return func(*args, **kwargs)
RuntimeError: [enforce fail at pybind_state.cc:1111] success. Error running net generalized_rcnn 
```

May I know why I get these errors?
Repository: rust
Issue: If finalize_session_directory is called after errors it complains about missing session dir
Labels: T-compiler,A-incr-comp,C-bug

It first deletes the session dir https://github.com/rust-lang/rust/blob/db1acaac7f8c84d8fb46211f5e96f678c28628a8/src/librustc_incremental/persist/fs.rs#L325-L335
And then tries to rename the session dir https://github.com/rust-lang/rust/blob/db1acaac7f8c84d8fb46211f5e96f678c28628a8/src/librustc_incremental/persist/fs.rs#L366-L383

It should return after deleting the session dir.
Repository: go
Issue: cmd/go: diagnose platform-specific identifiers when building for other platforms
Labels: NeedsInvestigation,FeatureRequest


### What version of Go are you using (`go version`)?

go version go1.10.3 darwin/amd64

### Does this issue reproduce with the latest release?

Yes

### What did you do?

main.go:

```
package main

func main() {
	foo()
}
```

foo_windows.go:

```
package main

import "fmt"

func foo() {
	fmt.Println("Windows")
}
```
Execute this command to get the error below:

```
$ GOOS=darwin go build
```

### What did you expect to see?

```
./main.go:4:2: undefined for darwin_amd64: foo (defined for windows)
```


### What did you see instead?

```
./main.go:4:2: undefined: foo
```

### Context

When a colleague that had not used golang previously tried to compile some linux-specific project on OSX, they got the 'undefined' error above and assumed the project was simply broken, not that it was platform-specific. If the golang compiler gave this user a better error message, they most likely would have figured out their issue quicker.

It seems to me that when the compiler runs into an undefined function/constant/whatever, it would be really useful if it could look at the other platform-specific files in that directory and see if they are defined there. If so, it could emit a better error message noting that the function isn't defined for the particular platform that you're compiling for, but that it is defined for other platforms (and mention which ones).

Thinking about my imagined solution, when encountering this type of error the compiler could probably 'quickly' scan the AST of other platforms and see if the thing was defined there? In particular, since this would only be done on error, that wouldn't affect compile performance in general?

Thanks for your consideration.
Repository: pytorch
Issue: Reduce code duplication in interpolate and make it more generic
Labels: feature,triaged,module: interpolation

Currently, `torch.nn.functional.interpolate` has dedicated implementation for 1d, 2d and 3d data, as well as for nearest, bilinear and bicubic interpolation. The set of different kernels that are dispatched can be seen [here](https://github.com/pytorch/pytorch/blob/master/torch/nn/functional.py#L2050-L2079).

Those implementation are all very similar one to the other, and there is a lot of code duplication in there.
Compare for example [nearest](https://github.com/pytorch/pytorch/blob/master/aten/src/THNN/generic/SpatialUpSamplingNearest.c#L31-L95) with [bilinear](https://github.com/pytorch/pytorch/blob/master/aten/src/THNN/generic/SpatialUpSamplingBilinear.c#L33-L106).

I believe it is possible to refactor the underlying implementation so that we can have a single C++ / CUDA codepath, with minimal  code duplication.

This could be achieved in two independent steps (that could be done at the same time):
- factor out the different kernel computations, so that we have a generic `filter` that is used to compute the interpolation, plus the size of the filter as a struct. For an example, [see how Pillow implements it](https://github.com/python-pillow/Pillow/blob/master/src/libImaging/Resample.c#L9-L83), and then the interpolation coefficients can be generically computed [as in here](https://github.com/python-pillow/Pillow/blob/master/src/libImaging/Resample.c#L236).
- make the interpolate kernel separable (it is already separable in most cases). This means that we can have the user specify the dimensions he wants to interpolate as a list, and in the C++/CUDA code we have a loop over the dimensions. Something like `F.interpolate(image, dim=[-2, -1])` for spatial interpolation, or `F.interpolate(volume, dim=[-3, -2, -1])` for volumetric data. We can have reasonable defaults if `dim` is not specified (that depends on the shape of the input), to keep backwards compatibility.

The first point will allow us to fuse the `nearest` / `bilinear` / `bicubic` interpolation modes in a single file, while the second point will fuse `temporal` / `spatial` and `volumetric` into the same function.
Repository: puppeteer
Issue: feature: expose page.on('networkidle0') and page.on('networkidle2') events
Labels: feature,chromium

This has been requested quite a few times on the bugtracker already.

As a workaround, network idleness [can be emulated](https://github.com/GoogleChrome/puppeteer/issues/1353#issuecomment-356561654) on the puppeteer-side.
Repository: rust
Issue: "invert" borrow computation
Labels: C-enhancement,P-medium,I-compiletime,T-compiler,A-NLL,WG-compiler-performance,NLL-performant

I think we can make the process of checking borrows more efficient. Right now, we use a dataflow computation to compute the "borrows in scope" at each point. Then we walk over the MIR. At each point, whenever we access a path `P1`, we execute over the borrows in scope and look for any which conflict with `P1`. If we find any, we report an error.

I think what we should do instead is this: walk over all the borrows. For each borrow, do a DFS from the point of the borrow. Stop the DFS when we either (a) exit the borrow region or (b) detect that the path which was borrowed was overwritten. (We already do a very similar computation.) During that DFS, we look at the paths that are accessed by each statement we traverse, and check if they conflict with the borrow. (This will require us to efficiently index the paths that are accessed by a given location.)

This is a non-trivial amount of refactoring but I think it will be a win. We're already doing the DFS as part of the `precompute_borrows_out_of_scope` routine -- the only difference is that now we'll be checking the paths accessed by each statement as we go. But we can make that efficient by using a simple hashing scheme like the one described in #53159.

In exchange, we get to avoid doing an extra dataflow computation. This means one less dataflow to do and also one less thing to update.