Repository: kythe/kythe
Pull request #4156 (2019-10-23 22:13:20)

chore: Count sources by their required input vname corpus


Patch:
diff --git a/kythe/go/platform/kzip/info/info.go b/kythe/go/platform/kzip/info/info.go
index 8cf887305..618a1d39d 100644
--- a/kythe/go/platform/kzip/info/info.go
+++ b/kythe/go/platform/kzip/info/info.go
@@ -30,7 +30,7 @@ import (
 
 // If the compilation unit doesn't set a corpus, use this corpus so we have somewhere to record the
 // stats.
-const unknownCorpus = "__UNKNOWN_CORPUS__"
+const unspecifiedCorpus = "__UNSPECIFIED_CORPUS__"
 
 // KzipInfo scans a kzip and counts contained files and units, giving a breakdown by corpus and language.
 func KzipInfo(f kzip.File, scanOpts ...kzip.ScanOption) (*apb.KzipInfo, error) {
@@ -42,30 +42,27 @@ func KzipInfo(f kzip.File, scanOpts ...kzip.ScanOption) (*apb.KzipInfo, error) {
 		// The corpus may be specified in the unit VName or in the source file
 		// VNames. Record all values of corpus seen and afterwards check that a
 		// single value is specified.
-		var corpora stringset.Set
 		cuCorpus := u.Proto.GetVName().GetCorpus()
-		if cuCorpus != "" {
-			corpora.Add(cuCorpus)
-		} else {
+		if cuCorpus == "" {
 			log.Printf("Warning: Corpus not set for compilation unit %v", u.Proto.GetVName())
-			cuCorpus = unknownCorpus
+			cuCorpus = unspecifiedCorpus
 		}
 		cuLang := u.Proto.GetVName().GetLanguage()
 		cuInfo := cuLangInfo(cuCorpus, cuLang, kzipInfo)
 		cuInfo.Count++
-		cuInfo.Sources += int32(srcs.Len())
 
+		var srcCorpora stringset.Set
 		for _, ri := range u.Proto.RequiredInput {
-			cuInfo.RequiredInputs++
 			riCorpus := ri.GetVName().GetCorpus()
 			requiredInputInfo(riCorpus, cuLang, kzipInfo).Count++
 			if srcs.Contains(ri.Info.Path) {
-				corpora.Add(riCorpus)
+				sourceInfo(riCorpus, cuLang, kzipInfo).Count++
+				srcCorpora.Add(riCorpus)
 			}
 		}
-		if len(corpora) != 1 {
+		if srcCorpora.Len() != 1 {
 			// This is a warning for now, but may become an error.
-			log.Printf("Multiple corpora in unit. unit vname={%v}; src corpora=%v; srcs=%v", u.Proto.GetVName(), corpora, u.Proto.SourceFile)
+			log.Printf("Multiple corpora in unit. unit vname={%v}; src corpora=%v; srcs=%v", u.Proto.GetVName(), srcCorpora, u.Proto.SourceFile)
 		}
 		return nil
 	}, scanOpts...)
@@ -81,6 +78,7 @@ func KzipInfoTotalCount(infos []*apb.KzipInfo) apb.KzipInfo_CorpusInfo {
 	totals := apb.KzipInfo_CorpusInfo{
 		LanguageCompilationUnits: make(map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits),
 		LanguageRequiredInputs:   make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
+		LanguageSources:          make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 	}
 	for _, info := range infos {
 		for _, i := range info.GetCorpora() {
@@ -91,8 +89,6 @@ func KzipInfoTotalCount(infos []*apb.KzipInfo) apb.KzipInfo_CorpusInfo {
 					totals.LanguageCompilationUnits[lang] = langTotal
 				}
 				langTotal.Count += stats.GetCount()
-				langTotal.Sources += stats.GetSources()
-				langTotal.RequiredInputs += stats.GetRequiredInputs()
 			}
 			for lang, stats := range i.GetLanguageRequiredInputs() {
 				total := totals.LanguageRequiredInputs[lang]
@@ -102,6 +98,14 @@ func KzipInfoTotalCount(infos []*apb.KzipInfo) apb.KzipInfo_CorpusInfo {
 				}
 				total.Count += stats.GetCount()
 			}
+			for lang, stats := range i.GetLanguageSources() {
+				total := totals.LanguageSources[lang]
+				if total == nil {
+					total = &apb.KzipInfo_CorpusInfo_RequiredInputs{}
+					totals.LanguageSources[lang] = total
+				}
+				total.Count += stats.GetCount()
+			}
 		}
 	}
 	return totals
@@ -116,12 +120,14 @@ func MergeKzipInfo(infos []*apb.KzipInfo) *apb.KzipInfo {
 			for lang, cu := range cinfo.GetLanguageCompilationUnits() {
 				cui := cuLangInfo(corpus, lang, kzipInfo)
 				cui.Count += cu.GetCount()
-				cui.Sources += cu.GetSources()
-				cui.RequiredInputs += cu.GetRequiredInputs()
 			}
-			for lang, cu := range cinfo.GetLanguageRequiredInputs() {
+			for lang, inputs := range cinfo.GetLanguageRequiredInputs() {
 				c := requiredInputInfo(corpus, lang, kzipInfo)
-				c.Count += cu.GetCount()
+				c.Count += inputs.GetCount()
+			}
+			for lang, sources := range cinfo.GetLanguageSources() {
+				c := sourceInfo(corpus, lang, kzipInfo)
+				c.Count += sources.GetCount()
 			}
 		}
 	}
@@ -148,12 +154,23 @@ func requiredInputInfo(corpus, lang string, kzipInfo *apb.KzipInfo) *apb.KzipInf
 	return lri
 }
 
+func sourceInfo(corpus, lang string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo_RequiredInputs {
+	c := corpusInfo(corpus, kzipInfo)
+	ls := c.LanguageSources[lang]
+	if ls == nil {
+		ls = &apb.KzipInfo_CorpusInfo_RequiredInputs{}
+		c.LanguageSources[lang] = ls
+	}
+	return ls
+}
+
 func corpusInfo(corpus string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo {
 	i := kzipInfo.GetCorpora()[corpus]
 	if i == nil {
 		i = &apb.KzipInfo_CorpusInfo{
 			LanguageCompilationUnits: make(map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits),
 			LanguageRequiredInputs:   make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
+			LanguageSources:          make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 		}
 		kzipInfo.Corpora[corpus] = i
 	}
diff --git a/kythe/proto/analysis.proto b/kythe/proto/analysis.proto
index 4dbe7a0c8..a4c9f1d21 100644
--- a/kythe/proto/analysis.proto
+++ b/kythe/proto/analysis.proto
@@ -188,12 +188,10 @@ message KzipInfo {
     // The count of data present in compilation units for a given corpus and
     // language.
     message CompilationUnits {
+      reserved 2, 3;
+
       // Number of compilation units that have a specific corpus in their VName.
       int32 count = 1;
-      // Number of source files mentioned in these compilation units.
-      int32 sources = 2;
-      // Number of required inputs mentioned in these compilation units.
-      int32 required_inputs = 3;
     }
 
     // Map from compilation unit language to stats about compilation units with
@@ -201,12 +199,16 @@ message KzipInfo {
     map<string, CompilationUnits> language_compilation_units = 3;
 
     message RequiredInputs {
+      // TODO(salguarnieri) Add count of unique inputs for this corpus?
       int32 count = 1;
     }
 
-    // Map from required input language to count of required inputs that have
-    // this corpus in their VName.
+    // Map from language to count of required inputs that have this corpus in
+    // their VName.
     map<string, RequiredInputs> language_required_inputs = 4;
+    // Map from language to count of sources that have this corpus in their
+    // required_input VName.
+    map<string, RequiredInputs> language_sources = 5;
   }
 
   // Map from corpus name to corpus info.
diff --git a/kythe/proto/analysis_go_proto/analysis.pb.go b/kythe/proto/analysis_go_proto/analysis.pb.go
index 65fecab52..ae04ff5e8 100644
--- a/kythe/proto/analysis_go_proto/analysis.pb.go
+++ b/kythe/proto/analysis_go_proto/analysis.pb.go
@@ -462,6 +462,7 @@ func (m *KzipInfo) GetCorpora() map[string]*KzipInfo_CorpusInfo {
 type KzipInfo_CorpusInfo struct {
 	LanguageCompilationUnits map[string]*KzipInfo_CorpusInfo_CompilationUnits `protobuf:"bytes,3,rep,name=language_compilation_units,json=languageCompilationUnits,proto3" json:"language_compilation_units,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
 	LanguageRequiredInputs   map[string]*KzipInfo_CorpusInfo_RequiredInputs   `protobuf:"bytes,4,rep,name=language_required_inputs,json=languageRequiredInputs,proto3" json:"language_required_inputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+	LanguageSources          map[string]*KzipInfo_CorpusInfo_RequiredInputs   `protobuf:"bytes,5,rep,name=language_sources,json=languageSources,proto3" json:"language_sources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
 	XXX_NoUnkeyedLiteral     struct{}                                         `json:"-"`
 	XXX_unrecognized         []byte                                           `json:"-"`
 	XXX_sizecache            int32                                            `json:"-"`
@@ -506,10 +507,15 @@ func (m *KzipInfo_CorpusInfo) GetLanguageRequiredInputs() map[string]*KzipInfo_C
 	return nil
 }
 
+func (m *KzipInfo_CorpusInfo) GetLanguageSources() map[string]*KzipInfo_CorpusInfo_RequiredInputs {
+	if m != nil {
+		return m.LanguageSources
+	}
+	return nil
+}
+
 type KzipInfo_CorpusInfo_CompilationUnits struct {
 	Count                int32    `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
-	Sources              int32    `protobuf:"varint,2,opt,name=sources,proto3" json:"sources,omitempty"`
-	RequiredInputs       int32    `protobuf:"varint,3,opt,name=required_inputs,json=requiredInputs,proto3" json:"required_inputs,omitempty"`
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
 	XXX_sizecache        int32    `json:"-"`
@@ -547,20 +553,6 @@ func (m *KzipInfo_CorpusInfo_CompilationUnits) GetCount() int32 {
 	return 0
 }
 
-func (m *KzipInfo_CorpusInfo_CompilationUnits) GetSources() int32 {
-	if m != nil {
-		return m.Sources
-	}
-	return 0
-}
-
-func (m *KzipInfo_CorpusInfo_CompilationUnits) GetRequiredInputs() int32 {
-	if m != nil {
-		return m.RequiredInputs
-	}
-	return 0
-}
-
 type KzipInfo_CorpusInfo_RequiredInputs struct {
 	Count                int32    `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -887,6 +879,7 @@ func init() {
 	proto.RegisterType((*KzipInfo_CorpusInfo)(nil), "kythe.proto.KzipInfo.CorpusInfo")
 	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_CompilationUnits)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageCompilationUnitsEntry")
 	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageRequiredInputsEntry")
+	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageSourcesEntry")
 	proto.RegisterType((*KzipInfo_CorpusInfo_CompilationUnits)(nil), "kythe.proto.KzipInfo.CorpusInfo.CompilationUnits")
 	proto.RegisterType((*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.RequiredInputs")
 	proto.RegisterType((*FilesRequest)(nil), "kythe.proto.FilesRequest")
@@ -900,73 +893,74 @@ func init() {
 func init() { proto.RegisterFile("kythe/proto/analysis.proto", fileDescriptor_8e4ea7eca60afe48) }
 
 var fileDescriptor_8e4ea7eca60afe48 = []byte{
-	// 1079 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x5b, 0x6f, 0x1b, 0xc5,
-	0x17, 0xff, 0xaf, 0xef, 0x3e, 0x76, 0x1d, 0x67, 0xfe, 0xa5, 0xda, 0x6e, 0x5b, 0xd5, 0x32, 0x6a,
-	0x69, 0x29, 0x72, 0x20, 0x48, 0x05, 0x35, 0x55, 0xa4, 0x5c, 0x0c, 0x72, 0x9a, 0xa6, 0xb0, 0x69,
-	0xfb, 0x80, 0x90, 0x56, 0x13, 0xef, 0xd8, 0x19, 0x65, 0x3d, 0xe3, 0xce, 0xcc, 0x9a, 0xba, 0x42,
-	0x7c, 0x0d, 0x1e, 0x79, 0xe0, 0x0d, 0xf1, 0xc8, 0x47, 0xe1, 0xc3, 0xf0, 0x88, 0x66, 0x66, 0xd7,
-	0xde, 0x4d, 0x73, 0x2b, 0x4f, 0x9e, 0xdf, 0xb9, 0xfd, 0xce, 0x9c, 0xcb, 0x78, 0xc1, 0x3b, 0x99,
-	0xab, 0x63, 0xb2, 0x36, 0x15, 0x5c, 0xf1, 0x35, 0xcc, 0x70, 0x34, 0x97, 0x54, 0xf6, 0x0c, 0x44,
-	0x0d, 0xa3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c, 0x7b, 0x50, 0x36, 0x18, 0xdd, 0x86, 0x7a,
-	0xfa, 0x75, 0x64, 0xdb, 0x5a, 0xf7, 0x97, 0x82, 0xed, 0xaf, 0xe0, 0xee, 0x90, 0x4f, 0xd2, 0x87,
-	0x3b, 0x24, 0x33, 0xc5, 0x79, 0x24, 0xb3, 0x4c, 0x3f, 0xac, 0xa6, 0x5f, 0x90, 0xc1, 0x98, 0x07,
-	0x46, 0xf4, 0x8f, 0xe3, 0x1c, 0x55, 0xcc, 0xe9, 0xcb, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1d,
-	0x66, 0x59, 0xe8, 0x6c, 0x0a, 0x00, 0x00,
+	// 1091 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5b, 0x6f, 0x1b, 0x45,
+	0x14, 0x66, 0x7d, 0xf7, 0xb1, 0x9b, 0x38, 0x43, 0xa8, 0xb6, 0xdb, 0x56, 0xb5, 0x8c, 0x5a, 0xa5,
+	0x14, 0x6d, 0xc0, 0x40, 0x41, 0x4d, 0x15, 0x29, 0x17, 0x83, 0x9c, 0xa6, 0x29, 0x6c, 0xda, 0x3e,
+	0x20, 0xa4, 0x65, 0xe2, 0x1d, 0x3b, 0xa3, 0xac, 0x67, 0xdc, 0x9d, 0x59, 0x53, 0x57, 0x88, 0xbf,
+	0xc1, 0x0f, 0xe0, 0x0d, 0xf1, 0xc8, 0x3b, 0x7f, 0x8a, 0x07, 0x1e, 0xd1, 0xcc, 0xec, 0xda, 0xbb,
+	0x69, 0x6e, 0x45, 0xe2, 0x69, 0xe7, 0x5c, 0xbf, 0x33, 0xe7, 0xb6, 0x03, 0xce, 0xc9, 0x4c, 0x1e,
+	0x93, 0xf5, 0x49, 0xc4, 0x25, 0x5f, 0xc7, 0x0c, 0x87, 0x33, 0x41, 0x85, 0xab, 0x49, 0xd4, 0xd0,
+	0x32, 0x43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 0x4c, 0x95, 0x9f, 0x24, 0x05, 0x77, 0x73, 0x26, 0x6f, 0x23,
+	0x18, 0x96, 0x67, 0x6c, 0x9c, 0xbb, 0x50, 0xd6, 0x34, 0xba, 0x05, 0xf5, 0xf4, 0xf5, 0x66, 0xca,
+	0x5a, 0xf7, 0x16, 0x8c, 0xed, 0x2f, 0xe1, 0xce, 0x80, 0x8f, 0xd3, 0x1f, 0x4b, 0x40, 0xa6, 0x92,
+	0xf3, 0x50, 0x64, 0x91, 0xbe, 0x5f, 0x49, 0x5f, 0xb8, 0xfe, 0x88, 0xfb, 0x9a, 0xf5, 0x8f, 0x65,
+	0x1d, 0x55, 0xf4, 0xe9, 0xb3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x7c, 0x20, 0x69, 0x0c,
+	0x0b, 0x00, 0x00,
 }


Test patch:
diff --git a/kythe/go/platform/kzip/info/info_test.go b/kythe/go/platform/kzip/info/info_test.go
index 9ea4a7cd9..386f6b4da 100644
--- a/kythe/go/platform/kzip/info/info_test.go
+++ b/kythe/go/platform/kzip/info/info_test.go
@@ -31,9 +31,7 @@ func TestMergeKzipInfo(t *testing.T) {
 				"corpus1": {
 					LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
 						"python": {
-							Count:          1,
-							Sources:        1,
-							RequiredInputs: 2,
+							Count: 1,
 						},
 					},
 					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
@@ -41,6 +39,11 @@ func TestMergeKzipInfo(t *testing.T) {
 							Count: 2,
 						},
 					},
+					LanguageSources: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+						"python": {
+							Count: 1,
+						},
+					},
 				},
 			},
 		},
@@ -49,14 +52,10 @@ func TestMergeKzipInfo(t *testing.T) {
 				"corpus1": {
 					LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
 						"python": {
-							Count:          1,
-							Sources:        0,
-							RequiredInputs: 0,
+							Count: 1,
 						},
 						"go": {
-							Count:          1,
-							Sources:        0,
-							RequiredInputs: 2,
+							Count: 1,
 						},
 					},
 					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
@@ -68,14 +67,18 @@ func TestMergeKzipInfo(t *testing.T) {
 				"corpus2": {
 					LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
 						"python": {
-							Count:          4,
-							Sources:        5,
-							RequiredInputs: 9,
+							Count: 4,
 						},
 						"java": {
-							Count:          3,
-							Sources:        3,
-							RequiredInputs: 20,
+							Count: 3,
+						},
+					},
+					LanguageSources: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+						"python": {
+							Count: 5,
+						},
+						"java": {
+							Count: 3,
 						},
 					},
 				},
@@ -101,14 +104,10 @@ func TestMergeKzipInfo(t *testing.T) {
 			"corpus1": {
 				LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
 					"python": {
-						Count:          2,
-						Sources:        1,
-						RequiredInputs: 2,
+						Count: 2,
 					},
 					"go": {
-						Count:          1,
-						Sources:        0,
-						RequiredInputs: 2,
+						Count: 1,
 					},
 				},
 				LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
@@ -116,18 +115,27 @@ func TestMergeKzipInfo(t *testing.T) {
 						Count: 3,
 					},
 				},
+				LanguageSources: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+					"python": {
+						Count: 1,
+					},
+				},
 			},
 			"corpus2": {
 				LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
 					"python": {
-						Count:          4,
-						Sources:        5,
-						RequiredInputs: 9,
+						Count: 4,
+					},
+					"java": {
+						Count: 3,
+					},
+				},
+				LanguageSources: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+					"python": {
+						Count: 5,
 					},
 					"java": {
-						Count:          3,
-						Sources:        3,
-						RequiredInputs: 20,
+						Count: 3,
 					},
 				},
 			},
@@ -149,19 +157,13 @@ func TestMergeKzipInfo(t *testing.T) {
 	wantTotal := apb.KzipInfo_CorpusInfo{
 		LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
 			"python": {
-				Count:          6,
-				Sources:        6,
-				RequiredInputs: 11,
+				Count: 6,
 			},
 			"go": {
-				Count:          1,
-				Sources:        0,
-				RequiredInputs: 2,
+				Count: 1,
 			},
 			"java": {
-				Count:          3,
-				Sources:        3,
-				RequiredInputs: 20,
+				Count: 3,
 			},
 		},
 		LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
@@ -175,6 +177,14 @@ func TestMergeKzipInfo(t *testing.T) {
 				Count: 2,
 			},
 		},
+		LanguageSources: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+			"python": {
+				Count: 6,
+			},
+			"java": {
+				Count: 3,
+			},
+		},
 	}
 
 	got := MergeKzipInfo(infos)